add url param for audio volume.
This commit is contained in:
parent
d08d3eccef
commit
98ba32c574
@ -181,6 +181,11 @@
|
|||||||
|
|
||||||
shakeKbd = false
|
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() {
|
get isCastMode() {
|
||||||
return !!new URL(location.href).searchParams.get('cast')
|
return !!new URL(location.href).searchParams.get('cast')
|
||||||
}
|
}
|
||||||
@ -197,6 +202,11 @@
|
|||||||
return this.isCastMode || this.isEmbedMode
|
return this.isCastMode || this.isEmbedMode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Watch('volume', { immediate: true })
|
||||||
|
onVolume(volume: number) {
|
||||||
|
this.$accessor.video.setVolume(volume)
|
||||||
|
}
|
||||||
|
|
||||||
@Watch('hideControls', { immediate: true })
|
@Watch('hideControls', { immediate: true })
|
||||||
onHideControls(enabled: boolean) {
|
onHideControls(enabled: boolean) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
|
Reference in New Issue
Block a user