From 8c3b70898142df5a6d59e9098bf3a3bd699e3bdd Mon Sep 17 00:00:00 2001 From: Alexis Faizeau Date: Sat, 2 Oct 2021 15:55:54 +0200 Subject: [PATCH] Remove audio manager range volume control by keys (#1489) Co-authored-by: Alexis Faizeau --- .../Components/AudioManager/AudioManager.svelte | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/front/src/Components/AudioManager/AudioManager.svelte b/front/src/Components/AudioManager/AudioManager.svelte index a7f96f61..e201254c 100644 --- a/front/src/Components/AudioManager/AudioManager.svelte +++ b/front/src/Components/AudioManager/AudioManager.svelte @@ -23,6 +23,8 @@ audioManagerVolumeStore.setMuted(localUserStore.getAudioPlayerMuted()); changeVolume(); + loadAudioSettings(); + unsubscriberFileStore = audioManagerFileStore.subscribe(() => { HTMLAudioPlayer.pause(); HTMLAudioPlayer.loop = get(audioManagerVolumeStore).loop; @@ -79,6 +81,11 @@ changeVolume(); } + function loadAudioSettings() { + audioManagerVolumeStore.setVolume(localUserStore.getAudioPlayerVolume()); + audioManagerVolumeStore.setMuted(localUserStore.getAudioPlayerMuted()); + } + function setVolume() { volume = parseFloat(audioPlayerVol.value); audioManagerVolumeStore.setVolume(volume); @@ -88,6 +95,11 @@ changeVolume(); } + function disallowKeys() { + audioPlayerVol.blur(); + return false; + } + function setDecrease() { audioManagerVolumeStore.setDecreaseWhileTalking(decreaseWhileTalking); } @@ -116,7 +128,7 @@ - +