fix: ensure video unmuted in async play callbacks after loop
This commit is contained in:
@@ -77,6 +77,7 @@ export class VideoManager {
|
|||||||
this.elB!.style.opacity = '0'
|
this.elB!.style.opacity = '0'
|
||||||
|
|
||||||
this.waitReady(this.elA).then(() => {
|
this.waitReady(this.elA).then(() => {
|
||||||
|
this.elA!.muted = false
|
||||||
this.elA!.currentTime = 0
|
this.elA!.currentTime = 0
|
||||||
this.elA!.play().catch(() => {})
|
this.elA!.play().catch(() => {})
|
||||||
})
|
})
|
||||||
@@ -124,6 +125,7 @@ export class VideoManager {
|
|||||||
this.switching = true
|
this.switching = true
|
||||||
|
|
||||||
inactive.currentTime = 0
|
inactive.currentTime = 0
|
||||||
|
inactive.muted = false
|
||||||
inactive.play().catch(() => {})
|
inactive.play().catch(() => {})
|
||||||
|
|
||||||
active.style.transition = `opacity ${this.crossFadeMs}ms ease`
|
active.style.transition = `opacity ${this.crossFadeMs}ms ease`
|
||||||
|
|||||||
Reference in New Issue
Block a user