Return to Media Player on BackButton press - Windows Phone

87 views Asked by At

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?

1

There are 1 answers

0
topher91 On

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);
}