Fullscreen mode

Topics: Windows 10 UWP
Jul 15, 2015 at 1:50 PM
Hi there,
How can we enable the fullscreen mode using the player framework?
Using the Xaml.Controls.MediaElement we can go to fullscreen with the IsFullWindow property, but
using the same property in Microsoft.PlayerFramework.MediaPlayer the video goes only FullWindow and doesn´t render any other element like the (custom) player controls we have.

Thank you
Coordinator
Jul 15, 2015 at 8:05 PM
Looking into this.
Coordinator
Jul 20, 2015 at 6:12 PM
Unfortunately, there is not currently a good way to add elements on top of the window when in full window mode (IsFullWindow = true) which means that the PF controls get hidden. You can set AreTransportControlsEnabled = true when in full window mode which will enable the out of the box controls however, this presents some challenges on phone currently.

We'll continue to look for a solution but, in the meantime, I think the best course of action would be as follows if possible:

In your IsFullScreenChanged event handler, programmatically hide the non player elements on the screen to allow your player to expand.
Coordinator
Jul 20, 2015 at 7:05 PM
Simple example:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="auto"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <TextBlock x:Name="Title" Text="Wildlife"/>
    <mmppf:MediaPlayer 
        x:Name="Player" 
        Grid.Column="1" 
        Source="http://smf.blob.core.windows.net/samples/videos/wildlife.mp4" 
        IsFullScreenVisible="True" 
        IsFullScreenChanged="Player_IsFullScreenChanged"/>
</Grid>
Code behind:
    private void Player_IsFullScreenChanged(object sender, RoutedPropertyChangedEventArgs<bool> e)
    {
        if (Player.IsFullScreen)
            Title.Visibility = Visibility.Collapsed;
        else
            Title.Visibility = Visibility.Visible;
    }
Jul 21, 2015 at 11:09 AM
Yes, that´s what we´re doing, we re-arrange the interface so the player can use the fullwindow without using the IsFullWindow property
I was worried because I thought that property was also used to make the player fullscreen but seems like we need to use:

ApplicationView.GetForCurrentView().TryEnterFullScreenMode() to make that, right?


One more thing, is there any possibility to keep the audio playing when the user minimizes the window?
The mmppf:MediaPlayer AudioCategory="BackgroundCapableMedia" doesn´t have any effect


Thank you!
Coordinator
Jul 21, 2015 at 2:27 PM
Edited Jul 21, 2015 at 2:32 PM
ApplicationView.GetForCurrentView().TryEnterFullScreenMode() is indeed correct.

For BG audio, the BackgroundMediaPlayer APIs need to be used. Take a look at the following sample:

https://github.com/Microsoft/Windows-universal-samples/tree/master/backgroundaudio

Something like:
    private void Player_IsFullScreenChanged(object sender, RoutedPropertyChangedEventArgs<bool> e)
    {
        if (Player.IsFullScreen)
        {
            Title.Visibility = Visibility.Collapsed;
            Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
        }
        else
        {
            Title.Visibility = Visibility.Visible;
            Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().ExitFullScreenMode();
        }
    }
Jul 21, 2015 at 3:30 PM
Thank you ibennett.