fix: Set focus on video after playback buttons pressed

This commit is contained in:
Oleksandr Bezdieniezhnykh
2024-05-19 00:02:59 +03:00
parent 57cfb46470
commit f179a5f0ca
+2 -1
View File
@@ -14,7 +14,7 @@ public class PlayerControlHandler(LibVLC libVLC, MediaPlayer mediaPlayer, MainWi
private const int STEP = 20; private const int STEP = 20;
private const int LARGE_STEP = 5000; private const int LARGE_STEP = 5000;
private static readonly string[] CatchSenders = ["ForegroundWindow", "ScrollViewer"]; private static readonly string[] CatchSenders = ["ForegroundWindow", "ScrollViewer", "VideoView"];
private readonly Dictionary<Key, PlaybackControlEnum> KeysControlEnumDict = new() private readonly Dictionary<Key, PlaybackControlEnum> KeysControlEnumDict = new()
{ {
@@ -63,6 +63,7 @@ public class PlayerControlHandler(LibVLC libVLC, MediaPlayer mediaPlayer, MainWi
public async Task Handle(PlaybackControlEvent notification, CancellationToken cancellationToken) public async Task Handle(PlaybackControlEvent notification, CancellationToken cancellationToken)
{ {
await ControlPlayback(notification.PlaybackControl); await ControlPlayback(notification.PlaybackControl);
mainWindow.VideoView.Focus();
} }
private async Task ControlPlayback(PlaybackControlEnum controlEnum) private async Task ControlPlayback(PlaybackControlEnum controlEnum)