Prevent volume/mute status from propagating across open tabs.
This commit is contained in:
parent
a6519f6f83
commit
20a9439f64
|
@ -69,7 +69,7 @@ import AudioPlayer from '~/components/Common/AudioPlayer.vue';
|
|||
import formatTime from '~/functions/formatTime.js';
|
||||
import Icon from '~/components/Common/Icon.vue';
|
||||
import {usePlayerStore} from "~/store.js";
|
||||
import {useStorage} from "@vueuse/core";
|
||||
import {useLocalStorage} from "@vueuse/core";
|
||||
import {computed, ref, toRef} from "vue";
|
||||
import MuteButton from "~/components/Common/MuteButton.vue";
|
||||
|
||||
|
@ -77,8 +77,12 @@ const store = usePlayerStore();
|
|||
const isPlaying = toRef(store, 'isPlaying');
|
||||
const current = toRef(store, 'current');
|
||||
|
||||
const volume = useStorage('player_volume', 55);
|
||||
const isMuted = useStorage('player_is_muted', false);
|
||||
const volume = useLocalStorage('player_volume', 55, {
|
||||
listenToStorageChanges: false
|
||||
});
|
||||
const isMuted = useLocalStorage('player_is_muted', false, {
|
||||
listenToStorageChanges: false
|
||||
});
|
||||
const $player = ref(); // AudioPlayer
|
||||
|
||||
const duration = computed(() => {
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
import AudioPlayer from '~/components/Common/AudioPlayer';
|
||||
import PlayButton from "~/components/Common/PlayButton";
|
||||
import {computed, onMounted, ref, shallowRef, watch} from "vue";
|
||||
import {useStorage} from "@vueuse/core";
|
||||
import {useLocalStorage} from "@vueuse/core";
|
||||
import formatTime from "~/functions/formatTime";
|
||||
import {useTranslate} from "~/vendor/gettext";
|
||||
import useNowPlaying from "~/functions/useNowPlaying";
|
||||
|
@ -240,8 +240,12 @@ const currentTimeTotalDisplay = computed(() => {
|
|||
|
||||
const $player = ref(); // Template ref
|
||||
|
||||
const volume = useStorage('player_volume', 55);
|
||||
const isMuted = useStorage('player_is_muted', false);
|
||||
const volume = useLocalStorage('player_volume', 55, {
|
||||
listenToStorageChanges: false
|
||||
});
|
||||
const isMuted = useLocalStorage('player_is_muted', false, {
|
||||
listenToStorageChanges: false
|
||||
});
|
||||
|
||||
const toggleMute = () => {
|
||||
isMuted.value = !isMuted.value;
|
||||
|
|
Loading…
Reference in New Issue