From d81042174a2a62ef77627cf1690fa4dd0d25c2e6 Mon Sep 17 00:00:00 2001 From: cocos02 Date: Mon, 8 Jun 2026 14:32:34 +0800 Subject: [PATCH] fix: skip crossfade when switching to same video, replay from start --- engine/core/VideoManager.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/core/VideoManager.ts b/engine/core/VideoManager.ts index 1812910..3e1846a 100644 --- a/engine/core/VideoManager.ts +++ b/engine/core/VideoManager.ts @@ -78,6 +78,12 @@ export class VideoManager { switchTo(src: string, preloadUrls: string[]) { if (!this.elA || this.switching) return + if (src === this.currentSrc) { + this.active.currentTime = 0 + this.active.play().catch(() => {}) + return + } + const inKey = this.inactiveKey const alreadyPreloaded = this.preloaded.get(inKey)