Skip to content

Visualize Your Ideas With Code

feat(core): seek to beginning of timeline in disable loop mode (#823)

Sita Vaibhavi Gunturi359564645575
diff --git a/packages/core/src/app/Player.ts b/packages/core/src/app/Player.ts
index 5e09d303..340d7f8a 100644
--- a/packages/core/src/app/Player.ts
+++ b/packages/core/src/app/Player.ts
@@ -356,12 +356,15 @@ export class Player {
}
// Pause if reached the end or the range is 0
+ // Seek to the beginning for non-empty scenes
if (
(!state.loop && this.finished && !state.paused && state.seek < 0) ||
this.endFrame === this.startFrame
) {
this.togglePlayback(false);
state.paused = true;
+ state.seek =
+ this.endFrame === this.startFrame ? state.seek : this.startFrame;
}
// Seek to the beginning if looping is enabled