Can I capture - Headphone Plug-out event/notification in WP8 / Lumia 920?
In my application, which will be playing mp3 music over headphone - can I get "Headphone Plug-out event/notification in WP8 / Lumia 920?" - take some required actions?
Re: Can I capture - Headphone Plug-out event/notification in WP8 / Lumia 920?
This was covered a while ago on StackOverflow, it also applies to WP8...
[url]http://stackoverflow.com/questions/9706706/detecting-plug-unplug-of-headphones-in-wp7[/url]
Re: Can I capture - Headphone Plug-out event/notification in WP8 / Lumia 920?
[QUOTE=theothernt;911344]This was covered a while ago on StackOverflow, it also applies to WP8...
[url]http://stackoverflow.com/questions/9706706/detecting-plug-unplug-of-headphones-in-wp7[/url][/QUOTE]
Got it - it say's - "when a song is playing on a background AudioPlayerAgent and the user unplugs the headphone, the AudioPlayerAgent receives a pause UserAction and pauses the music"
Will the same Pause action/method will be called on the background Audio player - in case of a incoming call also ?
If yes, how to identify it that - this pause is called from headphone plugout event not due to any other reason ?
In my app -- I wish to launch some kind of SOS actions from a background app which is playing music - in case the headphone is plug-out -- while the user is listening to music.... but for this I have to uniquely identify this event......!!! Can I ?
Re: Can I capture - Headphone Plug-out event/notification in WP8 / Lumia 920?
Short answer is: no.
Background Audio overview: [url]http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394039(v=vs.105).aspx[/url]
All the values for the PlayState enum: [url]http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.backgroundaudio.playstate(v=vs.105).aspx[/url]
Basically, the OS abstracts the action of 1) pulling out the headphones 2) incoming/outgoing call 3) and the user pausing the music with the OS controls to the 'pause' state.