diff --git a/client/src/app.vue b/client/src/app.vue index 2540245..a150859 100644 --- a/client/src/app.vue +++ b/client/src/app.vue @@ -181,6 +181,11 @@ shakeKbd = false + get volume() { + const numberParam = parseFloat(new URL(location.href).searchParams.get('volume') || '1.0') + return Math.max(0.0, Math.min(!isNaN(numberParam) ? numberParam * 100 : 100, 100)) + } + get isCastMode() { return !!new URL(location.href).searchParams.get('cast') } @@ -197,6 +202,11 @@ return this.isCastMode || this.isEmbedMode } + @Watch('volume', { immediate: true }) + onVolume(volume: number) { + this.$accessor.video.setVolume(volume) + } + @Watch('hideControls', { immediate: true }) onHideControls(enabled: boolean) { if (enabled) {