Use ACTION_AUDIO_BECOMING_NOISY instead of HEADSET_PLUG to better pause the playback.