mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add url param for audio volume.
This commit is contained in:
parent
d08d3eccef
commit
98ba32c574
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user