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?
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?
This was covered a while ago on StackOverflow, it also applies to WP8...
http://stackoverflow.com/questions/9...dphones-in-wp7
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 ?
Last edited by im2amit; 2013-02-17 at 02:58.
Short answer is: no.
Background Audio overview: http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx
All the values for the PlayState enum: http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx
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.