diff --git a/static/player.ts b/static/player.ts index 10a3116..b585ff4 100644 --- a/static/player.ts +++ b/static/player.ts @@ -118,6 +118,7 @@ const initPlayer = (): void => { let completionSent = false let completionAttempts = 0 let playerControlsTimeout: number | undefined + let isFullscreen = false let isScrubbing = false let lastKnownVolume = 1 let pendingSeekTime: number | null = null @@ -1310,6 +1311,12 @@ const initPlayer = (): void => { updateSkipButton(video.currentTime) }) + document.addEventListener('fullscreenchange', () => { + isFullscreen = !!document.fullscreenElement + container.classList.toggle('fullscreen', isFullscreen) + if (isFullscreen) showControls() + }) + container.addEventListener('mousemove', showControls) document.addEventListener('keydown', (event) => { diff --git a/static/style.css b/static/style.css index 6e1808a..b631cc1 100644 --- a/static/style.css +++ b/static/style.css @@ -113,3 +113,20 @@ body { scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05); } } + +.show-controls [data-video-overlay] { + opacity: 1; +} + +[data-video-player].fullscreen:not(.show-controls) [data-video-overlay] { + opacity: 0 !important; + pointer-events: none; +} + +[data-video-player].fullscreen:not(.show-controls) { + cursor: none; +} + +[data-video-player].fullscreen:not(.show-controls) video { + cursor: none; +} diff --git a/templates/components/video_player.gohtml b/templates/components/video_player.gohtml index 992fc46..68c0b5a 100644 --- a/templates/components/video_player.gohtml +++ b/templates/components/video_player.gohtml @@ -118,8 +118,8 @@ -
+
{{end}} \ No newline at end of file