diff options
| author | altaf-creator <dev@altafcreator.com> | 2026-05-31 10:45:44 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2026-05-31 10:45:44 +0800 |
| commit | e944308db6de30153fdb86a67d6c913186fe8d89 (patch) | |
| tree | 134db26ba4da6c75ba75cc3d26e70f11d801a6d9 /www/scripts/video.js | |
| parent | 8fea6e4be4a61cd2bfcb310166fbe6b2541b9ff4 (diff) | |
youtube videos, events, about me wip
Diffstat (limited to 'www/scripts/video.js')
| -rw-r--r-- | www/scripts/video.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/www/scripts/video.js b/www/scripts/video.js index 9f32e96..bb5bb80 100644 --- a/www/scripts/video.js +++ b/www/scripts/video.js @@ -1,4 +1,6 @@ const video = document.getElementById("video"); +const videoParent = document.getElementById("video-parent"); +const videoSection = document.getElementById("video-section"); const videoControlsProgress = document.getElementById("video-controls-progress"); const videoControlsPlay = document.getElementById("video-controls-play"); const videoControlsVolume = document.getElementById("video-controls-mutetoggle"); @@ -55,13 +57,15 @@ function toggleMaximisation() { if (videoMaximised) { videoMaximised = false; videoControlsMaximise.innerHTML = `<i class="fa-solid fa-maximize"></i>`; - video.exitFullscreen(); - video.controls = false; + videoParent.classList.remove("video-fullscreen"); + videoSection.appendChild(videoParent); + document.exitFullscreen(); } else { videoMaximised = true; videoControlsMaximise.innerHTML = `<i class="fa-solid fa-minimize"></i>`; - video.requestFullscreen(); - video.controls = true; + videoParent.classList.add("video-fullscreen"); + document.body.appendChild(videoParent); + document.documentElement.requestFullscreen(); } } |
