提交 3b5322af 编写于 作者: R rafael-rosa-knowcode 提交者: Jerome Laban

chore: mute

上级 1c812bdb
......@@ -125,7 +125,14 @@ public partial class GTKMediaPlayer : Border
_videoView.Visible = true;
}
}
public void Mute(bool IsMuted)
{
if (_videoView != null && _mediaPlayer != null)
{
Console.WriteLine($"Mute {IsMuted}");
_mediaPlayer.Mute = IsMuted;
}
}
public string Source
{
get => (string)GetValue(SourceProperty);
......
......@@ -388,19 +388,12 @@ public partial class MediaPlayerExtension : IMediaPlayerExtension
public void SetSurfaceSize(Size size) => throw new NotImplementedException();
public void ToggleMute()
{
if (_owner.IsMuted)
{
_player?.SetVolume(0);
}
else
if (_player is not null)
{
var volume = (int)(_owner.Volume / 100);
_player?.SetVolume(volume);
_player?.Mute(_owner.IsMuted);
}
}
public void OnOptionChanged(string name, object value) => throw new NotImplementedException();
public void Dispose()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册