I've had an app fail in the Marketplace due to my audio MediaElement
not accounting for background music. Okay. So I've gone about scouring everything and figuring out how account for this:
Source
of my WMA in
XAML. Load the source in
code-behind, snag the MediaOpened
event and .Play
it there.FrameworkDispatcher.Update
, see if
MediaPlayer.State =
MediaState.Playing
and if so,
.Pause
it and then after the snag
to MediaEnded
, .Resume
it.This kind of works. Where it doesn't work is in debug mode. Not with the emulator, not with the device, not with WPConnect.exe. What does work is when I disconnect my phone and run background music, launch my app and then click my audio MediaElement. Stopping, resuming the radio is also working like this.
However, what isn't working, is if I have an audio podcast playing in the background and then do my "does work" scenario. It will always stop the audio podcast and never resume it.
Has anyone been able to get around this? Is it a cause of failure for the Marketplace as well (besides just background music)?
P.S. SoundEffect
in XNA is NOT an option to be considered for my app.
This seems related to the NoDo update.
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