diff --git a/src/components/VideoPlayer2.tsx b/src/components/VideoPlayer2.tsx index 431001354..3622b57fd 100644 --- a/src/components/VideoPlayer2.tsx +++ b/src/components/VideoPlayer2.tsx @@ -159,7 +159,7 @@ export const VideoPlayer: FunctionComponent = ({ player.volume(0); } event.stopPropagation(); - break; + break; case 'KeyK': // 'K' key for play/pause toggle if (player.paused()) { player.play(); @@ -169,11 +169,15 @@ export const VideoPlayer: FunctionComponent = ({ event.stopPropagation(); break; case 'KeyJ': // 'J' key for seeking backward 10 seconds multiplied by the playback rate - player.currentTime(player.currentTime() - (10 * player.playbackRate())); + player.currentTime( + player.currentTime() - 10 * player.playbackRate(), + ); event.stopPropagation(); break; case 'KeyL': // 'L' key for seeking forward 10 seconds multiplied by the playback rate - player.currentTime(player.currentTime() + (10 * player.playbackRate())); + player.currentTime( + player.currentTime() + 10 * player.playbackRate(), + ); event.stopPropagation(); break; } @@ -294,6 +298,10 @@ export const VideoPlayer: FunctionComponent = ({ onReady(player); } }); + // Focus the video player when toggling fullscreen + player.on('fullscreenchange', () => { + videoElement.focus(); + }); }, ));