I am using a mediaelement and when the headset is unplugged I get a mediafailed event with NullReferenceException. Since the media element stream is not working anymore, I want to be able to distinguish this case and to handle it properly.
It is in the windows phone 7 design that when you unplug a headset or your headphones that the music player or other apps using the mediaelement should pause.
You can have a look at the CurrentStateChanged event to see if the state of the MediaElement is changed.
docs: http://msdn.microsoft.com/en-us/library/system.windows.controls.mediaelement.currentstatechanged%28VS.95%29.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With