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)