fix: handle loop seek in video ended callback, prevent duplicate end events

This commit is contained in:
2026-06-12 22:58:59 +08:00
parent db4f06883d
commit a603833d7e

View File

@@ -117,6 +117,14 @@ export class Engine {
.map(s => this.videoManager.resolveVideoUrl(s!, this.videoManager.streamingQuality))
this.videoManager.onEnd(() => {
if (this.loopActive && scene.loopEnd) {
this.videoManager.seekTo(scene.loopStart!)
return
}
if (scene.loopStart && !this.loopActive) {
this.checkLoop(scene.loopEnd || scene.loopStart)
return
}
if (!this.qteTriggered || this.qteResolved) {
this.emit('videoEnd', scene)
this.onVideoEnd(scene)