diff --git a/FoxTube/VideoPlayer.xaml.cs b/FoxTube/VideoPlayer.xaml.cs index 1038626..1a422b5 100644 --- a/FoxTube/VideoPlayer.xaml.cs +++ b/FoxTube/VideoPlayer.xaml.cs @@ -40,6 +40,8 @@ namespace FoxTube private bool fullScreen = false; private bool pointerCaptured = false; + UIElement rootBackup; + TimeSpan elapsed; TimeSpan remaining; TimeSpan total; @@ -95,7 +97,7 @@ namespace FoxTube item = response.Items[0]; - if(item.ContentDetails.ContentRating.RussiaRating == "russia18") + if(item.ContentDetails.ContentRating != null && item.ContentDetails.ContentRating.YtRating == "ytAgeRestricted") { matureBlock.Visibility = Visibility.Visible; return; @@ -321,19 +323,21 @@ namespace FoxTube } - private async void fullscreen_Click(object sender, RoutedEventArgs e) + private void fullscreen_Click(object sender, RoutedEventArgs e) { - if (miniViewed) - miniViewed = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default); - if (fullScreen) { + Window.Current.Content = rootBackup; ApplicationView.GetForCurrentView().ExitFullScreenMode(); fullScreen = false; } - else fullScreen = ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); + else + { + rootBackup = Window.Current.Content; + Window.Current.Content = this; + fullScreen = ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); + } if ((string)fullscreen.Content == "") - fullscreen.Content = ""; else fullscreen.Content = ""; }