EPG-Overlay zurueck in VideoView (HWND-Fix), WebView wird beim EPG-Oeffnen versteckt
This commit is contained in:
parent
d22808497d
commit
d0f9df0a64
2 changed files with 98 additions and 37 deletions
115
MainWindow.xaml
115
MainWindow.xaml
|
|
@ -236,7 +236,7 @@
|
||||||
Background="#01000000"
|
Background="#01000000"
|
||||||
PreviewMouseLeftButtonDown="VideoClickCatcher_DoubleClick">
|
PreviewMouseLeftButtonDown="VideoClickCatcher_DoubleClick">
|
||||||
<Grid>
|
<Grid>
|
||||||
<!-- Radio-Cover bei Audio-Streams — INNERHALB VideoView damit es die native HWND überdeckt -->
|
<!-- Radio-Cover bei Audio-Streams -->
|
||||||
<Border x:Name="RadioCover" Visibility="Collapsed" Background="#1A1A1A">
|
<Border x:Name="RadioCover" Visibility="Collapsed" Background="#1A1A1A">
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<Image x:Name="RadioLogo" Width="200" Height="200" Stretch="Uniform"
|
<Image x:Name="RadioLogo" Width="200" Height="200" Stretch="Uniform"
|
||||||
|
|
@ -253,6 +253,84 @@
|
||||||
TextWrapping="Wrap" TextAlignment="Center" MaxWidth="600"/>
|
TextWrapping="Wrap" TextAlignment="Center" MaxWidth="600"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<!-- EPG-Overlay: INNERHALB VideoView (HWND-Grenze)
|
||||||
|
VideoView wird beim EPG-Oeffnen immer sichtbar gemacht,
|
||||||
|
auch wenn WebView aktiv war -->
|
||||||
|
<Border x:Name="EpgOverlay" Visibility="Collapsed"
|
||||||
|
Background="#D8000000">
|
||||||
|
<DockPanel>
|
||||||
|
<Grid DockPanel.Dock="Top" Background="#0A0A0A" Height="60">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="0" Text="Programm"
|
||||||
|
Foreground="White" FontSize="24" FontWeight="Bold"
|
||||||
|
VerticalAlignment="Center" Margin="24,0"/>
|
||||||
|
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,16,0">
|
||||||
|
<TextBlock x:Name="TxtEpgDate" Foreground="#CCC" FontSize="14" VerticalAlignment="Center" Margin="0,0,16,0"/>
|
||||||
|
<TextBlock x:Name="TxtEpgTime" Foreground="White" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,16,0"/>
|
||||||
|
<Button x:Name="BtnCloseEpg" Content="✕" FontSize="18"
|
||||||
|
Width="40" Height="40"
|
||||||
|
Background="Transparent" Foreground="White" BorderThickness="0"
|
||||||
|
Cursor="Hand" Click="BtnCloseEpg_Click" ToolTip="Schließen (Esc)"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
<TextBlock x:Name="TxtEpgOverlayStatus" DockPanel.Dock="Bottom"
|
||||||
|
Foreground="#888" FontSize="11" Padding="24,8" Background="#0A0A0A"/>
|
||||||
|
<ScrollViewer x:Name="EpgScrollViewer"
|
||||||
|
HorizontalScrollBarVisibility="Auto"
|
||||||
|
VerticalScrollBarVisibility="Auto"
|
||||||
|
Background="#0A0A0A">
|
||||||
|
<ScrollViewer.Resources>
|
||||||
|
<Style TargetType="ScrollBar">
|
||||||
|
<Setter Property="Background" Value="#0E0E0E"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="Width" Value="10"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="ScrollBar">
|
||||||
|
<Grid Background="{TemplateBinding Background}">
|
||||||
|
<Track Name="PART_Track" IsDirectionReversed="true">
|
||||||
|
<Track.Thumb>
|
||||||
|
<Thumb>
|
||||||
|
<Thumb.Template>
|
||||||
|
<ControlTemplate TargetType="Thumb">
|
||||||
|
<Border x:Name="thumbBd" Background="#3A3A3A" CornerRadius="3" Margin="2"/>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter TargetName="thumbBd" Property="Background" Value="#555"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Thumb.Template>
|
||||||
|
</Thumb>
|
||||||
|
</Track.Thumb>
|
||||||
|
<Track.IncreaseRepeatButton>
|
||||||
|
<RepeatButton Background="Transparent" BorderThickness="0" Command="ScrollBar.PageDownCommand" IsTabStop="False"/>
|
||||||
|
</Track.IncreaseRepeatButton>
|
||||||
|
<Track.DecreaseRepeatButton>
|
||||||
|
<RepeatButton Background="Transparent" BorderThickness="0" Command="ScrollBar.PageUpCommand" IsTabStop="False"/>
|
||||||
|
</Track.DecreaseRepeatButton>
|
||||||
|
</Track>
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="Orientation" Value="Horizontal">
|
||||||
|
<Setter Property="Width" Value="Auto"/>
|
||||||
|
<Setter Property="Height" Value="10"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</ScrollViewer.Resources>
|
||||||
|
<Canvas x:Name="EpgCanvas"/>
|
||||||
|
</ScrollViewer>
|
||||||
|
</DockPanel>
|
||||||
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</vlc:VideoView>
|
</vlc:VideoView>
|
||||||
|
|
@ -260,41 +338,6 @@
|
||||||
<!-- WebView2 fuer Web-Sender -->
|
<!-- WebView2 fuer Web-Sender -->
|
||||||
<wv2:WebView2 x:Name="WebView" Visibility="Collapsed" Panel.ZIndex="5"/>
|
<wv2:WebView2 x:Name="WebView" Visibility="Collapsed" Panel.ZIndex="5"/>
|
||||||
|
|
||||||
<!-- EPG-Overlay: AUSSERHALB VideoView und WebView damit es immer sichtbar ist -->
|
|
||||||
<!-- Panel.ZIndex="10" stellt sicher dass es ueber VLC-HWND und WebView-HWND liegt -->
|
|
||||||
<Border x:Name="EpgOverlay" Visibility="Collapsed"
|
|
||||||
Background="#D8000000"
|
|
||||||
Panel.ZIndex="10">
|
|
||||||
<DockPanel>
|
|
||||||
<Grid DockPanel.Dock="Top" Background="#0A0A0A" Height="60">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Grid.Column="0" Text="Programm"
|
|
||||||
Foreground="White" FontSize="24" FontWeight="Bold"
|
|
||||||
VerticalAlignment="Center" Margin="24,0"/>
|
|
||||||
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,16,0">
|
|
||||||
<TextBlock x:Name="TxtEpgDate" Foreground="#CCC" FontSize="14" VerticalAlignment="Center" Margin="0,0,16,0"/>
|
|
||||||
<TextBlock x:Name="TxtEpgTime" Foreground="White" FontSize="18" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,16,0"/>
|
|
||||||
<Button x:Name="BtnCloseEpg" Content="✕" FontSize="18"
|
|
||||||
Width="40" Height="40"
|
|
||||||
Background="Transparent" Foreground="White" BorderThickness="0"
|
|
||||||
Cursor="Hand" Click="BtnCloseEpg_Click" ToolTip="Schließen (Esc)"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
<TextBlock x:Name="TxtEpgOverlayStatus" DockPanel.Dock="Bottom"
|
|
||||||
Foreground="#888" FontSize="11" Padding="24,8" Background="#0A0A0A"/>
|
|
||||||
<ScrollViewer x:Name="EpgScrollViewer"
|
|
||||||
HorizontalScrollBarVisibility="Auto"
|
|
||||||
VerticalScrollBarVisibility="Auto"
|
|
||||||
Background="#0A0A0A">
|
|
||||||
<Canvas x:Name="EpgCanvas"/>
|
|
||||||
</ScrollViewer>
|
|
||||||
</DockPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<TextBlock x:Name="TxtNoChannel"
|
<TextBlock x:Name="TxtNoChannel"
|
||||||
Text="Wähle einen Sender aus der Liste"
|
Text="Wähle einen Sender aus der Liste"
|
||||||
Foreground="#666" FontSize="18"
|
Foreground="#666" FontSize="18"
|
||||||
|
|
|
||||||
|
|
@ -761,16 +761,26 @@ public partial class MainWindow : Window
|
||||||
|
|
||||||
private async void BtnEpgGrid_Click(object sender, RoutedEventArgs e)
|
private async void BtnEpgGrid_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
// WebView pausieren (EPG-Overlay liegt jetzt ausserhalb der HWNDs, kein Visibility-Wechsel noetig)
|
// EPG-Overlay liegt innerhalb VideoView (HWND) - VideoView muss sichtbar sein
|
||||||
if (_currentChannel?.Kind == ChannelKind.Web && _webViewReady)
|
if (_currentChannel?.Kind == ChannelKind.Web && _webViewReady)
|
||||||
await WebView.CoreWebView2.ExecuteScriptAsync(
|
await WebView.CoreWebView2.ExecuteScriptAsync(
|
||||||
"document.querySelectorAll('video,audio').forEach(m => m.pause())");
|
"document.querySelectorAll('video,audio').forEach(m => m.pause())");
|
||||||
|
WebView.Visibility = Visibility.Collapsed;
|
||||||
|
VideoView.Visibility = Visibility.Visible;
|
||||||
|
VideoOverlay.Visibility = Visibility.Visible;
|
||||||
await ShowEpgOverlayAsync();
|
await ShowEpgOverlayAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnCloseEpg_Click(object sender, RoutedEventArgs e)
|
private void BtnCloseEpg_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
HideEpgOverlay();
|
HideEpgOverlay();
|
||||||
|
// Wenn Web-Sender: WebView wieder zeigen
|
||||||
|
if (_currentChannel?.Kind == ChannelKind.Web)
|
||||||
|
{
|
||||||
|
VideoView.Visibility = Visibility.Collapsed;
|
||||||
|
VideoOverlay.Visibility = Visibility.Collapsed;
|
||||||
|
WebView.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ────────── EPG-Overlay (Joyn-Style) ──────────
|
// ────────── EPG-Overlay (Joyn-Style) ──────────
|
||||||
|
|
@ -1113,7 +1123,15 @@ public partial class MainWindow : Window
|
||||||
case Key.F11: ToggleFullscreen(); e.Handled = true; break;
|
case Key.F11: ToggleFullscreen(); e.Handled = true; break;
|
||||||
case Key.Escape:
|
case Key.Escape:
|
||||||
if (EpgOverlay.Visibility == Visibility.Visible)
|
if (EpgOverlay.Visibility == Visibility.Visible)
|
||||||
|
{
|
||||||
HideEpgOverlay();
|
HideEpgOverlay();
|
||||||
|
if (_currentChannel?.Kind == ChannelKind.Web)
|
||||||
|
{
|
||||||
|
VideoView.Visibility = Visibility.Collapsed;
|
||||||
|
VideoOverlay.Visibility = Visibility.Collapsed;
|
||||||
|
WebView.Visibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (_isFullscreen) ToggleFullscreen();
|
else if (_isFullscreen) ToggleFullscreen();
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue