MediaElement stops background audio
I use MediaElement to play video in my app, and have a question about it. When i try to start play video in MediaElement, it stops (pauses) music playing in Background. That is a reason of fail my app certicication in App Hub. How to win this?
你必须问用户他是否想用这样的东西阻止音乐:
if (MediaPlayer.State == MediaState.Playing)
{
MessageBoxResult Choice;
Choice = MessageBox.Show("Media is currently playing, do you want to stop it ?", "Stop Player", MessageBoxButton.OKCancel);
if (Choice == MessageBoxResult.OK)
{
MediaPlayer.Stop();
FrameworkDispatcher.Update();
}
}
链接地址: http://www.djcxy.com/p/41790.html
上一篇: 如何在播放音频文件mp3时使MediaElement可见?
下一篇: MediaElement停止背景音频