From f11121638bc1033858d7e7f298c3002f7952b108 Mon Sep 17 00:00:00 2001 From: yeeharn Date: Fri, 11 Aug 2023 16:48:48 +0800 Subject: [PATCH] Fix muted --- src/VideoPlayer.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/VideoPlayer.tsx b/src/VideoPlayer.tsx index d607e85..faf4bb8 100644 --- a/src/VideoPlayer.tsx +++ b/src/VideoPlayer.tsx @@ -352,6 +352,10 @@ export const VideoPlayer = (props: VideoPlayerProps) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [showControls, loading]); + useEffect(() => { + setMuted(muted); + }, [muted]); + useEffect(() => { const newVolume = volumePosition / volumeWidth;