Merge pull request #276 from JipFr/dev

feat(player): add soundbar visibility thingie for M keyboard shortcut
This commit is contained in:
mrjvs 2023-04-24 00:08:36 +02:00 committed by GitHub
commit 6fb76908ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -7,12 +7,12 @@ export function useVolumeControl(descriptor: string) {
const controls = useControls(descriptor); const controls = useControls(descriptor);
const mediaPlaying = useMediaPlaying(descriptor); const mediaPlaying = useMediaPlaying(descriptor);
const toggleVolume = () => { const toggleVolume = (isKeyboardEvent = false) => {
if (mediaPlaying.volume > 0) { if (mediaPlaying.volume > 0) {
setStoredVolume(mediaPlaying.volume); setStoredVolume(mediaPlaying.volume);
controls.setVolume(0); controls.setVolume(0, isKeyboardEvent);
} else { } else {
controls.setVolume(storedVolume > 0 ? storedVolume : 1); controls.setVolume(storedVolume > 0 ? storedVolume : 1, isKeyboardEvent);
} }
}; };

View File

@ -60,7 +60,7 @@ export function KeyboardShortcutsAction() {
// Mute // Mute
case "m": case "m":
toggleVolume(); toggleVolume(true);
break; break;
// Decrease volume // Decrease volume