Refactor video playback logic in SlideshowManager for improved fallback handling

This commit is contained in:
CodeDevMLH
2026-02-13 01:36:26 +01:00
parent b85f52d8d3
commit f2d383ec61

View File

@@ -2722,9 +2722,6 @@ const SlideshowManager = {
endSeconds: player._endTime
});
// Explicitly call playVideo to ensure it starts
player.playVideo();
if (STATE.slideshow.isMuted) {
player.mute();
} else {
@@ -2744,6 +2741,12 @@ const SlideshowManager = {
}
}, 1000);
return true;
} else if (player && typeof player.seekTo === 'function') {
// Fallback if loadVideoById is not available or videoId missing but player object exists
const startTime = player._startTime || 0;
player.seekTo(startTime);
player.playVideo();
return true;
}
return false;