Skip to content

Commit

Permalink
refactor: add conditional check for opening the indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
kKaskak committed Jan 10, 2024
1 parent fd5be69 commit 03ec592
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/routes/Player/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,13 @@ const Player = ({ urlParams, queryParams }) => {

const onVolumeChangeRequested = React.useCallback((volume) => {
video.setProp('volume', volume);
openVolumeChangeIndicator();
if (immersed && !menusOpen) {
openVolumeChangeIndicator();
}

if (volumeChangeTimeout.current) clearTimeout(volumeChangeTimeout.current);
volumeChangeTimeout.current = setTimeout(closeVolumeChangeIndicator, 1500);
}, [openVolumeChangeIndicator, closeVolumeChangeIndicator]);
}, [immersed, menusOpen]);

const onSeekRequested = React.useCallback((time) => {
video.setProp('time', time);
Expand Down

0 comments on commit 03ec592

Please sign in to comment.