Greasy Fork is available in English.

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.

返信を投稿

返信を投稿するにはログインしてください。