Show blocked YouTube overlay immediately
This commit is contained in:
+1
-1
@@ -384,7 +384,6 @@ function setYoutubeStartPromptVisible(visible) {
|
||||
function requestYoutubePlayback(player, videoId, position) {
|
||||
const requestId = ++youtubePlaybackRequestId;
|
||||
const startedAt = Date.now();
|
||||
setYoutubeStartPromptVisible(false);
|
||||
|
||||
for (const delay of [0, 150, 750, 1500, 3000]) {
|
||||
setTimeout(() => {
|
||||
@@ -578,6 +577,7 @@ async function applyWatchState(state, { suppressEvents = true } = {}) {
|
||||
|
||||
if (youtubeReady) {
|
||||
if (shouldPlay) {
|
||||
setYoutubeStartPromptVisible(true);
|
||||
const sameVideo = player.getVideoData?.().video_id === currentYoutubeVideoId;
|
||||
const playerState = player.getPlayerState?.();
|
||||
if (sameVideo && ![YT.PlayerState.UNSTARTED, YT.PlayerState.CUED].includes(playerState)) {
|
||||
|
||||
Reference in New Issue
Block a user