diff --git a/public/app.js b/public/app.js index a50cf85..fa014e7 100644 --- a/public/app.js +++ b/public/app.js @@ -383,12 +383,17 @@ async function applyWatchState(state) { if (youtubeReady) { if (state.playing) { - if (player.getVideoData?.().video_id !== currentYoutubeVideoId) { - player.loadVideoById(currentYoutubeVideoId, position); - } else { + const sameVideo = player.getVideoData?.().video_id === currentYoutubeVideoId; + const playerState = player.getPlayerState?.(); + if (sameVideo && playerState === YT.PlayerState.PLAYING) { player.seekTo(position, true); + } else { + player.loadVideoById(currentYoutubeVideoId, position); } player.playVideo(); + setTimeout(() => { + player.playVideo(); + }, 150); } else { if (player.getVideoData?.().video_id !== currentYoutubeVideoId) { player.cueVideoById(currentYoutubeVideoId, position);