Skip to content

Commit

Permalink
chore: fix react-compiler checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictb committed Aug 8, 2024
1 parent da5edf8 commit 44ff609
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/VideoPlayer/BaseVideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ function BaseVideoPlayer({
[playVideo, videoResumeTryNumberRef],
);

const prevIsMuted = useRef(false);
const prevVolume = useRef(0);
const prevIsMutedRef = useRef(false);
const prevVolumeRef = useRef(0);

const handlePlaybackStatusUpdate = useCallback(
(status: AVPlaybackStatus) => {
Expand All @@ -146,14 +146,14 @@ function BaseVideoPlayer({
return;
}

if (prevIsMuted.current && prevVolume.current === 0 && !status.isMuted) {
if (prevIsMutedRef.current && prevVolumeRef.current === 0 && !status.isMuted) {
updateVolume(0.25);
}
if (isFullScreenRef.current && prevVolume.current !== 0 && status.volume === 0 && !status.isMuted) {
if (isFullScreenRef.current && prevVolumeRef.current !== 0 && status.volume === 0 && !status.isMuted) {
currentVideoPlayerRef.current?.setStatusAsync({isMuted: true});
}
prevIsMuted.current = status.isMuted;
prevVolume.current = status.volume;
prevIsMutedRef.current = status.isMuted;
prevVolumeRef.current = status.volume;

const isVideoPlaying = status.isPlaying;
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
Expand Down

0 comments on commit 44ff609

Please sign in to comment.