fix: handle loop seek in video ended callback, prevent duplicate end events
This commit is contained in:
@@ -117,6 +117,14 @@ export class Engine {
|
|||||||
.map(s => this.videoManager.resolveVideoUrl(s!, this.videoManager.streamingQuality))
|
.map(s => this.videoManager.resolveVideoUrl(s!, this.videoManager.streamingQuality))
|
||||||
|
|
||||||
this.videoManager.onEnd(() => {
|
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) {
|
if (!this.qteTriggered || this.qteResolved) {
|
||||||
this.emit('videoEnd', scene)
|
this.emit('videoEnd', scene)
|
||||||
this.onVideoEnd(scene)
|
this.onVideoEnd(scene)
|
||||||
|
|||||||
Reference in New Issue
Block a user