MediaElement disrupting Audio Podcast (MediaPlayer) in WP7

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:

  • Don't set the Source of my WMA in XAML. Load the source in code-behind, snag the MediaOpened event and .Play it there.
  • While doing #1 above, 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)?

    PS SoundEffect in XNA is NOT an option to be considered for my app.


    这似乎与NoDo更新有关。

    链接地址: http://www.djcxy.com/p/7198.html

    上一篇: 在Java中使用什么策略来进行分层重入读/写锁定?

    下一篇: MediaElement中断WP7中的音频播客(MediaPlayer)