From 4b21f43ba90cbcfe028a3fcb2ad9bd0b27ecf3d7 Mon Sep 17 00:00:00 2001 From: ashley Date: Fri, 12 Jul 2024 15:37:07 +0000 Subject: [PATCH] add volume :3 --- html/poketube.ejs | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index b8a2280a..65c8517d 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -805,12 +805,46 @@ background-color: #0000; video.addEventListener("dblclick", () => { document.documentElement.requestFullscreen(); }); + function handleVolumeChange(element) { + switch (element.volume) { + case 1: + element.volume = 0; + document.querySelector("#muteOption #new").innerText = "25%" + document.querySelector("#muteOption #current").innerText = "0%" + break; + case 0: + element.volume = 0.25; + document.querySelector("#muteOption #new").innerText = "50%" + document.querySelector("#muteOption #current").innerText = "25%" + break; + case 0.25: + element.volume = 0.5; + document.querySelector("#muteOption #new").innerText = "75%" + document.querySelector("#muteOption #current").innerText = "50%" + break; + case 0.5: + element.volume = 0.75; + document.querySelector("#muteOption #new").innerText = "100%" + document.querySelector("#muteOption #current").innerText = "75%" + break; + case 0.75: + element.volume = 1; + document.querySelector("#muteOption #new").innerText = "0%" + document.querySelector("#muteOption #current").innerText = "100%" + break; + default: + element.volume = 1; + document.querySelector("#muteOption #new").innerText = "0%" + document.querySelector("#muteOption #current").innerText = "100%" + break; + } + } document.getElementById("muteOption").addEventListener("click", () => { if(qua != "medium") { - aud.volume == 0 ? aud.volume = 1 : aud.volume = 0; + handleVolumeChange(aud) } else { - video.volume == 0 ? video.volume = 1 : video.volume = 0; + handleVolumeChange(video) } }); document.getElementById("syncOption").addEventListener("click", () => { @@ -1277,7 +1311,7 @@ Offical Discord Server! :3 Loop Video
- Mute/Unmute + Set volume to 0% (currently 100%)
Sync Audio/Video