0

I am developing a Windows Phone 8 app in which I utilize the MediaPlayerLauncher to play a short video.

If the user switches away from the app (e.g. by pressing the Windows button) while playing the video, and then presses the back button, the user is not directed back to the Media Player, but to the last page visited before instead.

Can this behavior be changed, so that the user is directed to the Media Player on a back button press?

Emiswelt
  • 3,909
  • 1
  • 38
  • 56
  • No, I don't think so. You could however save the playerStatus of the mediaplayer in your viewmodel before firing the launcher in a property. Whenever the app is being re-activated after being in a dormant state for some reason and that state property is "Playing" fire the launcher imidiately after you page loads. – Pantelis Jan 16 '14 at 19:22

1 Answers1

0

I'm not 100% regarding the mediaplayback but you can override the default back button behaviour using the below code.

You can then use any logic you want. It is worth mentioning that in order to get the app certified in the market place you must to about to exit the app by pressing the back button from the home page.

protected override void OnBackKeyPress (System.ComponentModel.CancelEventArgs e)
{
       base.OnBackKeyPress(e);
}
topher91
  • 222
  • 1
  • 5