diff --git a/FoxTube/VideoPlayer.xaml b/FoxTube/VideoPlayer.xaml
index ada1f39..4e32469 100644
--- a/FoxTube/VideoPlayer.xaml
+++ b/FoxTube/VideoPlayer.xaml
@@ -42,7 +42,7 @@
-
+
diff --git a/FoxTube/VideoPlayer.xaml.cs b/FoxTube/VideoPlayer.xaml.cs
index f02202a..3b1b5bb 100644
--- a/FoxTube/VideoPlayer.xaml.cs
+++ b/FoxTube/VideoPlayer.xaml.cs
@@ -25,6 +25,7 @@ using Windows.Networking.Connectivity;
using System.Diagnostics;
using Windows.Media;
using Windows.Storage.Streams;
+using Windows.UI.ViewManagement;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
@@ -34,6 +35,9 @@ namespace FoxTube
{
public string videoId;
+ private bool miniViewed = false;
+ private bool fullScreen = false;
+
YouTubeQuality videoQuality;
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
@@ -237,9 +241,17 @@ namespace FoxTube
}
- private void fullscreen_Click(object sender, RoutedEventArgs e)
+ private async void fullscreen_Click(object sender, RoutedEventArgs e)
{
+ if (miniViewed)
+ miniViewed = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default);
+ if (fullScreen)
+ {
+ ApplicationView.GetForCurrentView().ExitFullScreenMode();
+ fullScreen = false;
+ }
+ else fullScreen = ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
}
private void play_Click(object sender, RoutedEventArgs e)
@@ -280,5 +292,18 @@ namespace FoxTube
{
meteredNotification.Visibility = Visibility.Collapsed;
}
+
+ private async void miniView_Click(object sender, RoutedEventArgs e)
+ {
+ if(fullScreen)
+ {
+ ApplicationView.GetForCurrentView().ExitFullScreenMode();
+ fullScreen = false;
+ }
+
+ if (!miniViewed)
+ miniViewed = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay);
+ else miniViewed = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default);
+ }
}
}