fix: skip crossfade when switching to same video, replay from start
This commit is contained in:
@@ -78,6 +78,12 @@ export class VideoManager {
|
|||||||
switchTo(src: string, preloadUrls: string[]) {
|
switchTo(src: string, preloadUrls: string[]) {
|
||||||
if (!this.elA || this.switching) return
|
if (!this.elA || this.switching) return
|
||||||
|
|
||||||
|
if (src === this.currentSrc) {
|
||||||
|
this.active.currentTime = 0
|
||||||
|
this.active.play().catch(() => {})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const inKey = this.inactiveKey
|
const inKey = this.inactiveKey
|
||||||
const alreadyPreloaded = this.preloaded.get(inKey)
|
const alreadyPreloaded = this.preloaded.get(inKey)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user