fix: hide old video frame before crossfade when coming from image scene
This commit is contained in:
@@ -20,6 +20,7 @@ export class Engine {
|
|||||||
private isInitialScene = true
|
private isInitialScene = true
|
||||||
private qteTriggered = false
|
private qteTriggered = false
|
||||||
private qteResolved = false
|
private qteResolved = false
|
||||||
|
private justCameFromImage = false
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.sceneManager = new SceneManager()
|
this.sceneManager = new SceneManager()
|
||||||
@@ -61,6 +62,7 @@ export class Engine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (scene.type === 'image') {
|
if (scene.type === 'image') {
|
||||||
|
this.justCameFromImage = true
|
||||||
this.isInitialScene = false
|
this.isInitialScene = false
|
||||||
this.emit('sceneChange', scene)
|
this.emit('sceneChange', scene)
|
||||||
const visible = this.getVisibleHotspots(scene)
|
const visible = this.getVisibleHotspots(scene)
|
||||||
@@ -88,6 +90,14 @@ export class Engine {
|
|||||||
const activeEl = this.videoManager.getActiveVideoElement()
|
const activeEl = this.videoManager.getActiveVideoElement()
|
||||||
activeEl?.pause()
|
activeEl?.pause()
|
||||||
|
|
||||||
|
if (this.justCameFromImage) {
|
||||||
|
this.justCameFromImage = false
|
||||||
|
if (activeEl) {
|
||||||
|
activeEl.style.opacity = '0'
|
||||||
|
activeEl.style.transition = 'none'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isInitialScene) {
|
if (this.isInitialScene) {
|
||||||
this.isInitialScene = false
|
this.isInitialScene = false
|
||||||
this.videoManager.playInitial(scene.videoUrl, preloadUrls)
|
this.videoManager.playInitial(scene.videoUrl, preloadUrls)
|
||||||
|
|||||||
Reference in New Issue
Block a user