Skip to content

Commit

Permalink
Amazon_scrollVolume
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Oct 8, 2024
1 parent 8a5cd75 commit 85b8a52
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion firefox/skipper.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (settings.Video?.scrollVolume) Netflix_scrollVolume(video);
}
async function Netflix_scrollVolume(video) {
console.log("scrollVolume");
const volumeControl = document.querySelector('[data-uia*="control-volume"]:not(.enhanced)');
if (volumeControl) {
volumeControl.classList.add("enhanced");
Expand Down Expand Up @@ -875,10 +874,26 @@ if (isPrimeVideo || isNetflix || isDisney || isHotstar || isCrunchyroll || isHBO
if (settings.Amazon?.watchCredits) Amazon_Watch_Credits();
if (settings.Amazon?.speedSlider) Amazon_SpeedSlider(video);
if (settings.Amazon?.xray) Amazon_xray();
if (settings.Video?.scrollVolume) Amazon_scrollVolume();
}
const AmazonSkipIntroConfig = { attributes: true, attributeFilter: [".skipelement"], subtree: true, childList: true, attributeOldValue: false };
// const AmazonSkipIntro = new RegExp("skipelement", "i");
const AmazonSkipIntroObserver = new MutationObserver(Amazon_Intro);

async function Amazon_scrollVolume() {
const volumeControl = document.querySelector('[aria-label="Volume"]:not(.enhanced)');
if (volumeControl) {
volumeControl.classList.add("enhanced");
volumeControl?.addEventListener("wheel", (event) => {
const video = document.querySelector(AmazonVideoClass);
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;
console.log("test", event);
});
}
}
let lastIntroTime = -1;
function resetLastIntroTime() {
setTimeout(() => {
Expand Down

0 comments on commit 85b8a52

Please sign in to comment.