mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 08:21:50 -06:00
ix autoplay unmute.
This commit is contained in:
@@ -339,10 +339,13 @@
|
||||
|
||||
@Watch('muted')
|
||||
onMutedChanged(muted: boolean) {
|
||||
if (this._video) {
|
||||
if (this._video && this._video.muted != muted) {
|
||||
this._video.muted = muted
|
||||
this.startsMuted = muted
|
||||
if (!muted) this.mutedOverlay = false
|
||||
}
|
||||
|
||||
if (!muted) {
|
||||
this.mutedOverlay = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,9 +395,9 @@
|
||||
this._video.addEventListener('canplaythrough', () => {
|
||||
this.$accessor.video.setPlayable(true)
|
||||
if (this.autoplay) {
|
||||
// start as muted due to restrictive browsers autoplay policy
|
||||
if (this.startsMuted && (!document.hasFocus() || !this.$accessor.active)) {
|
||||
this.$accessor.video.setMuted(true)
|
||||
this._video.muted = true
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
|
||||
Reference in New Issue
Block a user