Skip to content

Commit

Permalink
Disney_scrollVolume
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Oct 8, 2024
1 parent 85b8a52 commit 4b22feb
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,26 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
Disney_addHomeButton();
if (settings.Disney?.selfAd) Disney_selfAd(video, time);
}
if (settings.Video?.scrollVolume) Disney_scrollVolume(video);
}
// let SetTimeToZeroOnce = null;
async function Disney_scrollVolume(video) {
const volumeControl = document.querySelector("div.audio-control:not(.enhanced)");
if (volumeControl) {
volumeControl.classList.add("enhanced");
volumeControl?.addEventListener("wheel", (event) => {
let volume = video.volume;
if (event.deltaY < 0) volume = Math.min(1, volume + 0.05);
else volume = Math.max(0, volume - 0.05);
video.volume = volume;
const sliderContainer = volumeControl.querySelector(".slider-container");
sliderContainer.firstChild.children[1].style.strokeDashoffset = 100 - volume * 100 + "px";
sliderContainer.children[1].style.height = volume * 100 + "%";
sliderContainer.children[2].style.height = volume * 100 + "%";
console.log("test", event);
});
}
}

async function Disney_Intro(video, time) {
// intro star wars andor Season 1 episode 2
// Recap Criminal Minds Season 1 Episode 2
Expand Down

0 comments on commit 4b22feb

Please sign in to comment.