Default Music Player randomly playing while headphones are plugged in
How long have you had your phone? One common cause of intermittent headphone connections like this can just be that after carrying your phone around in your pocket for months, it has picked up "pocket fluff" in the headphone socket. At first this just squashes down out of the way when your headphones are plugged in, but after a while so much builds up that it stops the headphones plugging in fully and making a secure connection.

Removing this fluff can be as simple as just pulling it out with a straightened paper clip (be careful when you stick it in there). This is what I found by in my headphone socket a little while ago with a paper clip.



There are also some slightly more complicated ways to give the socket a good clean.

This fluff problem is far more common with smart phones, than with stand-alone MP3 players or old-fashioned walkman-type devices, as you'd commonly leave the headphones permanently plugged into those older single-purpose devices, whereas people usually leave the headphone socket empty on general purpose smart phones most of the time, and slip them in and out of fluff and lint filled (and generating) trouser pockets.