fix: preload candidate URLs now use resolveVideoUrl in Web mode
This commit is contained in:
@@ -107,10 +107,14 @@ export class Engine {
|
|||||||
this.emit('sceneChange', scene)
|
this.emit('sceneChange', scene)
|
||||||
this.checkHotspotTime(scene, 0)
|
this.checkHotspotTime(scene, 0)
|
||||||
|
|
||||||
const preloadUrls = this.sceneManager.getCandidateUrls(
|
const candidateIds = this.sceneManager.getCandidateSceneIds(
|
||||||
scene,
|
scene,
|
||||||
(conds) => conds ? this.stateManager.evaluate(conds) : true
|
(conds) => conds ? this.stateManager.evaluate(conds) : true
|
||||||
)
|
)
|
||||||
|
const preloadUrls = candidateIds
|
||||||
|
.map(id => this.sceneManager.getScene(id))
|
||||||
|
.filter((s) => !!s && s.type !== 'image')
|
||||||
|
.map(s => this.videoManager.resolveVideoUrl(s!, this.videoManager.streamingQuality))
|
||||||
|
|
||||||
this.videoManager.onEnd(() => {
|
this.videoManager.onEnd(() => {
|
||||||
if (!this.qteTriggered || this.qteResolved) {
|
if (!this.qteTriggered || this.qteResolved) {
|
||||||
|
|||||||
@@ -57,9 +57,7 @@ export class SceneManager {
|
|||||||
return targets
|
return targets
|
||||||
}
|
}
|
||||||
|
|
||||||
getCandidateUrls(scene: SceneNode, evaluateCondition: (conds?: Condition[]) => boolean): string[] {
|
getCandidateSceneIds(scene: SceneNode, evaluateCondition: (conds?: Condition[]) => boolean): string[] {
|
||||||
return this.getCandidateTargetIds(scene, evaluateCondition)
|
return this.getCandidateTargetIds(scene, evaluateCondition)
|
||||||
.map(id => this.scenes[id]?.videoUrl)
|
|
||||||
.filter((url): url is string => !!url)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user