diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js index 19519fc..96869f6 100644 --- a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js +++ b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js @@ -2318,8 +2318,6 @@ const SlideshowManager = { } currentSlide.classList.add("active"); - - STATE.slideshow.currentSlideIndex = index; // Restore focus for TV mode navigation continuity requestAnimationFrame(() => { @@ -2354,6 +2352,8 @@ const SlideshowManager = { if (logo) logo.classList.add("animate"); } + STATE.slideshow.currentSlideIndex = index; + if (index === 0 || !previousVisibleSlide) { const dotsContainer = container.querySelector(".dots-container"); if (dotsContainer) { @@ -2708,7 +2708,7 @@ const SlideshowManager = { videoBackdrop.play().catch(() => { setTimeout(() => { - if (videoBackdrop.paused && slide.classList.contains('active')) { + if (videoBackdrop.paused) { console.warn(`Autoplay blocked for ${itemId}, attempting muted fallback`); videoBackdrop.muted = true; videoBackdrop.play().catch(err => console.error("Muted fallback failed", err)); @@ -2719,7 +2719,7 @@ const SlideshowManager = { } // YouTube player - const player = STATE.slideshow.videoPlayers?.[itemId]; + const player = STATE.slideshow.videoPlayers && STATE.slideshow.videoPlayers[itemId]; if (player && typeof player.loadVideoById === 'function' && player._videoId) { player.loadVideoById({ videoId: player._videoId, @@ -2735,8 +2735,6 @@ const SlideshowManager = { } setTimeout(() => { - if (!slide.classList.contains('active')) return; - if (player.getPlayerState && player.getPlayerState() !== YT.PlayerState.PLAYING && player.getPlayerState() !== YT.PlayerState.BUFFERING) {