Skip to content

Commit

Permalink
fix: remove onPause handler for autoplayed videos with pause icons
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmch committed Sep 26, 2023
1 parent 83d1f92 commit a7be789
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/ReactPlayer/ReactPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,11 @@ export const ReactPlayerBlock = React.forwardRef<ReactPlayerBlockHandler, ReactP
onStart={onStart}
onReady={setPlayerRef}
onPlay={onPlay}
onPause={onPause}
onPause={
autoPlay && customControlsType !== CustomControlsType.WithMuteButton
? undefined
: onPause
} // to prevent pause icon flickering when autoplayed video ends
onProgress={onProgress}
onEnded={onEnded}
aria-label={ariaLabel}
Expand Down

0 comments on commit a7be789

Please sign in to comment.