diff --git a/CHANGELOG.md b/CHANGELOG.md index 40684e02fad..ba80df91b04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ release channel, you can take advantage of these new features and fixes. - All web hooks can now have rate limits set for them, so they only dispatch once in the time specified, in case third-party services need to receive updates less frequently. +- Volume controls are hidden on iOS, as volume is immutable on that platform. + ## Bug Fixes - Fixed a bug where extra metadata (fade-in/out, cue-in/out, etc.) would not save on the Bulk Media Editor import. diff --git a/frontend/components/Common/Waveform.vue b/frontend/components/Common/Waveform.vue index c080f639871..424b21e0928 100644 --- a/frontend/components/Common/Waveform.vue +++ b/frontend/components/Common/Waveform.vue @@ -3,8 +3,8 @@
-
-
+
+
@@ -28,17 +28,15 @@
-
+
-
- +
+
-
- -
@@ -72,11 +60,11 @@ import WS from 'wavesurfer.js'; import timeline from 'wavesurfer.js/dist/plugins/timeline.js'; import regions from 'wavesurfer.js/dist/plugins/regions.js'; import getLogarithmicVolume from '~/functions/getLogarithmicVolume'; -import Icon from './Icon.vue'; import {onMounted, onUnmounted, ref, watch} from "vue"; import {useAxios} from "~/vendor/axios"; import usePlayerVolume from "~/functions/usePlayerVolume"; -import {IconVolumeOff, IconVolumeUp} from "~/components/Common/icons"; +import useShowVolume from "~/functions/useShowVolume.ts"; +import MuteButton from "~/components/Common/MuteButton.vue"; const props = defineProps({ audioUrl: { @@ -99,6 +87,14 @@ let wavesurfer = null; let wsRegions = null; const volume = usePlayerVolume(); +const showVolume = useShowVolume(); + +const isMuted = ref(false); + +const toggleMute = () => { + isMuted.value = !isMuted.value; +} + const zoom = ref(0); watch(zoom, (val) => { @@ -109,6 +105,10 @@ watch(volume, (val) => { wavesurfer?.setVolume(getLogarithmicVolume(val)); }); +watch(isMuted, (val) => { + wavesurfer?.setMuted(val); +}); + const isExternalJson = ref(false); const {axiosSilent} = useAxios(); diff --git a/frontend/components/InlinePlayer.vue b/frontend/components/InlinePlayer.vue index 56b07a16355..5a1d5ef4450 100644 --- a/frontend/components/InlinePlayer.vue +++ b/frontend/components/InlinePlayer.vue @@ -42,9 +42,9 @@ :aria-label="$gettext('Stop')" @click="stop()" > - + -
+
= ref(0); const currentTime: Ref = ref(0); const rawProgress: Ref = ref(0); diff --git a/frontend/components/Public/Player.vue b/frontend/components/Public/Player.vue index b20d07c9636..1740dd80e33 100644 --- a/frontend/components/Public/Player.vue +++ b/frontend/components/Public/Player.vue @@ -11,7 +11,7 @@ v-if="showAlbumArt && np.now_playing.song.art" class="now-playing-art" > - +
-
+
(() => { }); const volume = usePlayerVolume(); +const showVolume = useShowVolume(); const urlParamVolume = (new URL(document.location.href)).searchParams.get('volume'); if (null !== urlParamVolume) { diff --git a/frontend/functions/useShowVolume.ts b/frontend/functions/useShowVolume.ts new file mode 100644 index 00000000000..718aafa18af --- /dev/null +++ b/frontend/functions/useShowVolume.ts @@ -0,0 +1,10 @@ +import {useSupported} from "@vueuse/core"; +import {ComputedRef} from "vue"; + +export default function useShowVolume(): ComputedRef { + return useSupported(() => { + const audio = new Audio(); + audio.volume = 0.5; + return audio.volume !== 1; + }); +}