From 5b40781d0a5e9ad77c7921595d75525404e136ab Mon Sep 17 00:00:00 2001 From: cocos02 Date: Mon, 8 Jun 2026 21:24:28 +0800 Subject: [PATCH] fix: hide old video frame before crossfade when coming from image scene --- engine/core/Engine.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/core/Engine.ts b/engine/core/Engine.ts index 6e701a4..05baf99 100644 --- a/engine/core/Engine.ts +++ b/engine/core/Engine.ts @@ -20,6 +20,7 @@ export class Engine { private isInitialScene = true private qteTriggered = false private qteResolved = false + private justCameFromImage = false constructor() { this.sceneManager = new SceneManager() @@ -61,6 +62,7 @@ export class Engine { } if (scene.type === 'image') { + this.justCameFromImage = true this.isInitialScene = false this.emit('sceneChange', scene) const visible = this.getVisibleHotspots(scene) @@ -88,6 +90,14 @@ export class Engine { const activeEl = this.videoManager.getActiveVideoElement() activeEl?.pause() + if (this.justCameFromImage) { + this.justCameFromImage = false + if (activeEl) { + activeEl.style.opacity = '0' + activeEl.style.transition = 'none' + } + } + if (this.isInitialScene) { this.isInitialScene = false this.videoManager.playInitial(scene.videoUrl, preloadUrls)