Archived
2
0

lint fix.

This commit is contained in:
Miroslav Šedivý 2023-03-25 22:19:01 +01:00
parent 217cc451ea
commit b41d0bf956

View File

@ -390,14 +390,15 @@
try { try {
await this._video.play() await this._video.play()
} catch (err: any) { } catch (err: any) {
if (!this._video.muted ) { if (!this._video.muted) {
// video.play() can fail if audio is set due restrictive browsers autoplay policy // video.play() can fail if audio is set due restrictive
// retry with muted audio // browsers autoplay policy -> retry with muted audio
try { try {
this.$accessor.video.setMuted(true) this.$accessor.video.setMuted(true)
this._video.muted = true this._video.muted = true
await this._video.play() await this._video.play()
} catch (err: any) { } catch (err: any) {
// if it still fails, we're not playing anything
this.$accessor.video.pause() this.$accessor.video.pause()
} }
} else { } else {
@ -441,7 +442,6 @@
this._video.addEventListener('canplaythrough', () => { this._video.addEventListener('canplaythrough', () => {
this.$accessor.video.setPlayable(true) this.$accessor.video.setPlayable(true)
if (this.autoplay) { if (this.autoplay) {
this.$nextTick(() => { this.$nextTick(() => {
this.$accessor.video.play() this.$accessor.video.play()
}) })