I just started playing around with windows 8 development and I'm trying to figure out how to make a video whose source is from a url pop to full screen from either a button press or by double clicking on the area where the video is playing. Any idea on how to do that? As a followup, i'd also have to be able to minimize it back to it's normal playing window. Any ideas on how to do this using xaml C#?
Microsoft Media Platform Player Framework, make video fullscreen from button press (or double clicking on video)
2.5k Views Asked by Derick F At
2
There are 2 best solutions below
0

I used this code for fullWindow. It works but in full window it uses default transportcontrols
private void MediaPlayer_IsFullScreenChanged(object sender, Windows.UI.Xaml.RoutedPropertyChangedEventArgs<bool> e)
{
Microsoft.PlayerFramework.MediaPlayer mp = (sender as Microsoft.PlayerFramework.MediaPlayer);
mp.IsFullWindow = !mp.IsFullWindow;
}
The player framework has a boolean property called IsFullScreen to manage the fullscreen state. However, you need to do the work yourself to hide extra elements on the page and/or resize the mediaplayer. The recommended approach is to set this property and handle the IsFullScreenChanged event. For example:
Note: there is also a property on MediaPlayer call IsFullScreenVisible that you can set to true to show the fullscreen toggle button in the default control strip.