Refactor video playback logic in SlideshowManager for improved fallback handling
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user