mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
mute video if not focused
This commit is contained in:
@ -312,6 +312,10 @@
|
||||
this._video.addEventListener('canplaythrough', () => {
|
||||
this.$accessor.video.setPlayable(true)
|
||||
if (this.autoplay) {
|
||||
if (!document.hasFocus()) {
|
||||
this.$accessor.video.setMuted(true)
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$accessor.video.play()
|
||||
})
|
||||
|
Reference in New Issue
Block a user