Skip to content

Commit

Permalink
fix: video mute on video click (#942)
Browse files Browse the repository at this point in the history
Co-authored-by: vladkrk <vladkrk@yandex-team.ru>
  • Loading branch information
vladKrk and vladkrk committed May 7, 2024
1 parent 1c5ff0a commit 6c5f957
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/ReactPlayer/ReactPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,14 @@ export const ReactPlayerBlock = React.forwardRef<ReactPlayerBlockHandler, ReactP
}, [isPlaying, onPlay, onPause]);

const handleClick = useCallback(() => {
if (customControlsType === CustomControlsType.WithMuteButton) {
changeMute(muted);
} else {
onPlayClick();
if (controls === MediaVideoControlsType.Custom) {
if (customControlsType === CustomControlsType.WithMuteButton) {
changeMute(muted);
} else {
onPlayClick();
}
}
}, [changeMute, customControlsType, muted, onPlayClick]);
}, [changeMute, customControlsType, muted, onPlayClick, controls]);

const onFocusIn = useCallback(() => setHovered(true), []);
const onFocusOut = useCallback(() => setHovered(false), []);
Expand Down

0 comments on commit 6c5f957

Please sign in to comment.