HiAnime Auto 1080p

Automatically sets your Quality & Speed to your desired values, Auto Fullscreen, Auto Pause/Unpause when switching tabs, Auto Unmute, Auto Focus.

< 腳本HiAnime Auto 1080p的回應

提問/評論

§
發表於:2024-10-06
編輯:2024-10-06

This fixes a bug where it now pauses when switching windows (alt tabbing). (it's also marginally faster)

if (PauseOnFocusLoss == true){
var wasPlaying = false
document.addEventListener("visibilitychange", () => {
    if (document.visibilityState === 'hidden') {
        wasPlaying = jwplayer().getState() === 'playing'; // Capture state immediately
        jwplayer().pause(); // Pause when tab is hidden
    } else if (wasPlaying) {
        jwplayer().play(); // Resume only if it was playing
    }
});
}
Ghoste作者
§
發表於:2024-10-06

its not really a bug, the player disappears when the browser window is completely covered with a maximized window.
alt tabbing doesnt really do anything in my test as well unless the other window is maximized on the same screen.

its the exact same with your code by the way.

but i will use this as its more compact while having the same functionality, thank you.

§
發表於:2024-10-06

I'm using a mac and swiping, so maybe it's differnt than on windows

Ghoste作者
§
發表於:2024-10-06

maybe, yeah, i use brave browser on windows and your code is 1:1 with my previous code (i updated the script with yours already).

your code uses the same event listener in the same way so idk why it would function different on your end, weird.

發表回覆

登入以回復

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址