HiAnime Auto 1080p

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

< Commentaires sur HiAnime Auto 1080p

Question / commentaire

§
Posté le: 2024-10-06
Édité le: 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
    }
});
}
GhosteAuteur
§
Posté le: 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.

§
Posté le: 2024-10-06

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

GhosteAuteur
§
Posté le: 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.

Poster une réponse

Connectez-vous pour poster une réponse.