Why does music on iOS stop when unplugging headphones?

I have music playing through:


But when I unplug my headphones, music stops playing. When I re-plug them back in, the song doesn’t resume. Is this expected behavior that iOS games are to deal with somehow (like catch that the song stopped, resume it)?

I checked if either MediaPlayer.MediaStateChanged or MediaPlayer.ActiveSongChanged are raised, neither are.

More info:

Sound effects do still play, so I know audio isn’t fully shut off in my app.

If I call Play again (which occurs when I move to different screens in my game), the music does start up again, so I don’t think anything is wrong with the underlying audio system.

Looks like this can be handled manually through iOS specific events. More info here: