Stardet miniview implementation
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
<TextBlock Name="title" Grid.Column="1" Text="This is Video title" Foreground="White" VerticalAlignment="Center" TextWrapping="WrapWholeWords" FontSize="20" Margin="10,0,0,0" MaxLines="1" ToolTipService.ToolTip="Title"/>
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="2">
|
||||
<Button Background="Transparent" FontFamily="Segoe MDL2 Assets" Content="" Foreground="White" Width="50" Height="50" FontSize="25" ToolTipService.ToolTip="Cast to device"/>
|
||||
<Button Background="Transparent" FontFamily="Segoe MDL2 Assets" Content="" Foreground="White" Width="50" Height="50" FontSize="25" ToolTipService.ToolTip="Picture-in-picture mode"/>
|
||||
<Button Name="miniView" Click="miniView_Click" Background="Transparent" FontFamily="Segoe MDL2 Assets" Content="" Foreground="White" Width="50" Height="50" FontSize="25" ToolTipService.ToolTip="Picture-in-picture mode"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user