iTunes (on macbook) automatically starts playing music when head-phone is connected.

I just connected the head phone and started watching a movie in VLC. The suddenly itunes started automatically and launched a track from one of the playlists. I quit iTunes, but it restarted automatically and launched the music track again.

I quit it several times, but it keeps annoying me.

Moreover, while a certain music track is playing, it automatically pauses that track for a while and after a few seconds it is resumed again.

The above mentioned problems are only faced when my head-phone is connected. I've been using this head-phone for several days but it's today when I've started facing the problems.

I never changed the settings/preferences for itunes in the past few days. Please help me how can I avoid this problem.

Thanks in advance.
If it's a recently purchased machine, and you have AppleCare on it - I'd make an Apple GeniusBar appointment.

Original thread: https://forums.imore.com/threads/itunes-on-macbook-automatically-starts-playing-music-when-head-phone-is-connected.321986/