Skip to content

Commit 6677c57

Browse files
committed
fix(player): youtube does not play on first request
closes #1393
1 parent 5ac2894 commit 6677c57

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

packages/vidstack/src/providers/youtube/provider.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export class YouTubeProvider
290290
isPlaying = state === YouTubePlayerState.Playing,
291291
isBuffering = state === YouTubePlayerState.Buffering,
292292
isPendingPlay = this.#isPending('playVideo'),
293-
isPlay = (paused() || isPendingPlay) && (isBuffering || isPlaying);
293+
isPlay = paused() && (isBuffering || isPlaying);
294294

295295
if (isBuffering) this.#ctx.notify('waiting', undefined, trigger);
296296

@@ -321,12 +321,6 @@ export class YouTubeProvider
321321
}
322322

323323
switch (state) {
324-
case YouTubePlayerState.Unstarted:
325-
// These methods will only reject if a play/pause is actually pending.
326-
this.#playFail('provider rejected');
327-
this.#pauseFail('provider rejected');
328-
this.#ctx.notify('pause', undefined, trigger);
329-
break;
330324
case YouTubePlayerState.Cued:
331325
this.#onReady(trigger);
332326
break;

0 commit comments

Comments
 (0)