Skip to content

Commit

Permalink
fix(player/react): remotion provider should fire seeked
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Dec 8, 2023
1 parent a8131a1 commit d9322ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/react/src/providers/remotion/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class RemotionProvider implements MediaProviderAdapter {

protected _onFrameChange(frame: number) {
const { inFrame, fps } = this._src()!,
{ seeking } = this._ctx.$state,
time = Math.max(0, frame - inFrame!) / fps!;

this._frame.set((record) => ({
Expand All @@ -127,6 +128,11 @@ export class RemotionProvider implements MediaProviderAdapter {
currentTime: time,
played: this._getPlayedRange(time),
});

if (seeking()) {
tick();
this._notify('seeked', time);
}
}

protected _onFrameEnd() {
Expand Down

0 comments on commit d9322ee

Please sign in to comment.