Actually I think the headphone jack is either corroded / liquid damaged, very dirty contacts or worn out inside. This would cause the phone to think the play button is being pressed on the earphones intermittently.
I would recommend cleaning the headphone jack. I do these by using isopropyl alcohol and a cotton swab with some of the cotton removed to let it fit in the headphone jack and spin it a few times to clean. I start off with tweezers first carefully if there is dust.