summaryrefslogtreecommitdiff
path: root/www/scripts/video.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/scripts/video.js')
-rw-r--r--www/scripts/video.js12
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();
}
}