Skip to content

Commit

Permalink
fix: do not allow seeking during loading
Browse files Browse the repository at this point in the history
  • Loading branch information
slowmove committed Mar 8, 2022
1 parent f80f802 commit b8fef07
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/VideoEventFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ export class VideoEventFilter extends EmitterBaseClass {
}

private onSeeking(): void {
if ([PlayerState.Seeking, PlayerState.Ended].includes(this.state)) return;
if (
[PlayerState.Loading, PlayerState.Seeking, PlayerState.Ended].includes(
this.state
)
)
return;
clearTimeout(this.pauseDebounce);
this.setState(PlayerState.Seeking, true);
this.emit(PlayerEvents.Seeking);
Expand Down Expand Up @@ -130,6 +135,7 @@ export class VideoEventFilter extends EmitterBaseClass {
private onTimeUpdate(): void {
if (
[
PlayerState.Loading,
PlayerState.Paused,
PlayerState.Seeking,
PlayerState.Buffering,
Expand Down

0 comments on commit b8fef07

Please sign in to comment.