mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 10:19:07 +00:00
Mute video by default
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
Height="16" Width="16" Margin="5,5" Foreground="Gray"
|
Height="16" Width="16" Margin="5,5" Foreground="Gray"
|
||||||
Cursor="Hand" />
|
Cursor="Hand" />
|
||||||
<StackPanel DockPanel.Dock="Right" HorizontalAlignment="Center" VerticalAlignment="Center"
|
<StackPanel DockPanel.Dock="Right" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
Orientation="Horizontal" Margin="10,0,7,0">
|
Orientation="Horizontal" Margin="10,0,0,0">
|
||||||
<TextBlock FontSize="14"
|
<TextBlock FontSize="14"
|
||||||
Text="{Binding Position, ElementName=mediaElement,Converter={StaticResource DecimalToTimeSpanConverter}}" />
|
Text="{Binding Position, ElementName=mediaElement,Converter={StaticResource DecimalToTimeSpanConverter}}" />
|
||||||
<TextBlock FontSize="14" Text=" / " />
|
<TextBlock FontSize="14" Text=" / " />
|
||||||
@@ -36,7 +36,16 @@
|
|||||||
Value="{Binding Position, ElementName=mediaElement}"
|
Value="{Binding Position, ElementName=mediaElement}"
|
||||||
Maximum="{Binding NaturalDuration, ElementName=mediaElement, Mode=OneWay}" />
|
Maximum="{Binding NaturalDuration, ElementName=mediaElement, Mode=OneWay}" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
<Grid>
|
||||||
<ffmpeg:MediaElement x:Name="mediaElement" />
|
<ffmpeg:MediaElement x:Name="mediaElement" />
|
||||||
|
<Border x:Name="buttonMute" VerticalAlignment="Bottom" HorizontalAlignment="Right" Cursor="Hand" Margin="10,10" Width="100" Height="100">
|
||||||
|
<Border.Background>
|
||||||
|
<SolidColorBrush Color="Gray" Opacity="0.9"/>
|
||||||
|
</Border.Background>
|
||||||
|
<fa:ImageAwesome Icon="VolumeOff"
|
||||||
|
Height="60" Width="60" Foreground="White" />
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<Label x:Name="errorOverlay" Visibility="Collapsed" Background="#CCAAAAAA" VerticalContentAlignment="Center"
|
<Label x:Name="errorOverlay" Visibility="Collapsed" Background="#CCAAAAAA" VerticalContentAlignment="Center"
|
||||||
HorizontalContentAlignment="Center">
|
HorizontalContentAlignment="Center">
|
||||||
|
@@ -22,6 +22,11 @@ namespace QuickLook.Plugin.VideoViewer
|
|||||||
_context = context;
|
_context = context;
|
||||||
|
|
||||||
buttonPlayPause.MouseLeftButtonUp += TogglePlayPause;
|
buttonPlayPause.MouseLeftButtonUp += TogglePlayPause;
|
||||||
|
buttonMute.MouseLeftButtonUp += (sender, e) =>
|
||||||
|
{
|
||||||
|
mediaElement.IsMuted = false;
|
||||||
|
buttonMute.Visibility = System.Windows.Visibility.Collapsed;
|
||||||
|
};
|
||||||
|
|
||||||
mediaElement.PropertyChanged += ChangePlayPauseButton;
|
mediaElement.PropertyChanged += ChangePlayPauseButton;
|
||||||
mediaElement.MouseLeftButtonUp += TogglePlayPause;
|
mediaElement.MouseLeftButtonUp += TogglePlayPause;
|
||||||
@@ -67,6 +72,7 @@ namespace QuickLook.Plugin.VideoViewer
|
|||||||
public void LoadAndPlay(string path)
|
public void LoadAndPlay(string path)
|
||||||
{
|
{
|
||||||
mediaElement.Source = new Uri(path);
|
mediaElement.Source = new Uri(path);
|
||||||
|
mediaElement.IsMuted = true;
|
||||||
mediaElement.Play();
|
mediaElement.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user