From 5c164332dea13f4b38fc28196ea3945fc0e03559 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Mon, 18 Jun 2018 14:33:31 +0300 Subject: [PATCH] Video player develop,emt 3 --- FoxTube/VideoPlayer.xaml.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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 = ""; }