diff --git a/public/app.js b/public/app.js index e6ad814..e0dcf8a 100644 --- a/public/app.js +++ b/public/app.js @@ -494,6 +494,15 @@ function handleYoutubeStateChange(event) { } if (event.data === YT.PlayerState.PLAYING) { setYoutubeStartPromptVisible(false); + setTimeout(() => { + if ( + Date.now() < youtubeStartPromptAllowedUntil && + desiredYoutubePlaying && + youtubePlayer?.getPlayerState?.() !== YT.PlayerState.PLAYING + ) { + setYoutubeStartPromptVisible(true); + } + }, 700); } if (![YT.PlayerState.PLAYING, YT.PlayerState.PAUSED, YT.PlayerState.ENDED].includes(event.data)) { @@ -598,6 +607,9 @@ async function applyWatchState(state, { suppressEvents = true, allowStartPrompt } if (shouldPlay) { + if (allowStartPrompt) { + setYoutubeStartPromptVisible(true); + } const sameVideo = player.getVideoData?.().video_id === currentYoutubeVideoId; const playerState = player.getPlayerState?.(); if (sameVideo && ![YT.PlayerState.UNSTARTED, YT.PlayerState.CUED].includes(playerState)) {