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