From e944308db6de30153fdb86a67d6c913186fe8d89 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sun, 31 May 2026 10:45:44 +0800 Subject: youtube videos, events, about me wip --- www/scripts/video.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'www/scripts') 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 = ``; - video.exitFullscreen(); - video.controls = false; + videoParent.classList.remove("video-fullscreen"); + videoSection.appendChild(videoParent); + document.exitFullscreen(); } else { videoMaximised = true; videoControlsMaximise.innerHTML = ``; - video.requestFullscreen(); - video.controls = true; + videoParent.classList.add("video-fullscreen"); + document.body.appendChild(videoParent); + document.documentElement.requestFullscreen(); } } -- cgit v1.2.3