Skip to content

Commit

Permalink
fix: video dont starts from beginning on click (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladKrk authored May 2, 2024
1 parent 2f3628c commit 721b1ad
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/ReactPlayer/ReactPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export const ReactPlayerBlock = React.forwardRef<ReactPlayerBlockHandler, ReactP
if (
isMuted &&
playerRef &&
controls === MediaVideoControlsType.Custom &&
customControlsType === CustomControlsType.WithMuteButton
) {
playerRef.seekTo(0);
Expand All @@ -262,7 +263,15 @@ export const ReactPlayerBlock = React.forwardRef<ReactPlayerBlockHandler, ReactP
// In order to the progress bar to update (equals 0) before displaying
setTimeout(() => setMuted(!isMuted), 0);
},
[playerRef, customControlsType, playEvents, stopEvents, handleAnalytics, setProps],
[
playerRef,
customControlsType,
playEvents,
stopEvents,
handleAnalytics,
setProps,
controls,
],
);

const handleClickPreview = useCallback(() => {
Expand Down

0 comments on commit 721b1ad

Please sign in to comment.