This project is read-only.

Switching player to fullscreen when orientation changed to landscape

Topics: Windows Phone 8
Jul 17, 2013 at 2:49 PM
Edited Jul 17, 2013 at 2:56 PM
I have a player inside a pivot item. I'd like to switch to fullscreen when orientation changed to landscape.
Currently I'm doing it with these steps:
  1. Save media state
  2. Close and remove player from pivot item
  3. Add player to LayoutRoot childrens
  4. IsFullScreen = true
  5. SystemTray.IsVisible = false
and similar to restore original layout when portrait.

Is there any more efficient/correct way to do this?
Jul 18, 2013 at 10:05 PM
Unfortunately, reusing and reposition the same MediaPlayer instance is not easy when it's hosted inside a Pivot if you are trying to make it go fullscreen depending on orientation (as you discovered). I think the way you've described sounds good.

Thinking out loud: maybe you could put the MediaPlayer in the pivot but rather float it on top and calculate the position using a dummy control in the pivot and using TransformToVisual. But you might run into problems with scrolling and touch interactions intended to manipulate the pivot.