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.

< Feedback on HiAnime Auto 1080p

Soru/yorum

§
Gönderildi: 06.10.2024
Düzenlendi: 06.10.2024

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
    }
});
}
GhosteSahip
§
Gönderildi: 06.10.2024

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.

§
Gönderildi: 06.10.2024

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

GhosteSahip
§
Gönderildi: 06.10.2024

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.

Cevap paylaş

Yanıt göndermek için oturum açın.