Skip to content

Commit

Permalink
fix: update buffering logic
Browse files Browse the repository at this point in the history
  • Loading branch information
martinstark committed Mar 2, 2023
1 parent 8228392 commit 837f443
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/media-event-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ export const getVideoEventFilter = ({
!state.seeking &&
// Not already buffering
!state.buffering &&
// playbackRate is not 0
videoElement.playbackRate > 0 &&
// playbackRate is 0
videoElement.playbackRate === 0 &&
// videoElement does not indicate it's seeking
!videoElement.seeking

Expand Down Expand Up @@ -415,7 +415,7 @@ export const getVideoEventFilter = ({
const onTimeupdate = (): void => {
if (isNotReady()) return;

if (state.buffering) {
if (state.buffering && !videoElement.paused) {
state = {
...state,
buffering: false,
Expand Down

0 comments on commit 837f443

Please sign in to comment.