Skip to content

🎥 Make videos programmatically with React

`@remotion/media`: fix race condition when seeking outside of the video bounds

Igor Samokhovetsfc8f24246e11
diff --git a/packages/media/src/video/media-player.ts b/packages/media/src/video/media-player.ts
index cd9abbaf31..8600f1068a 100644
--- a/packages/media/src/video/media-player.ts
+++ b/packages/media/src/video/media-player.ts
@@ -307,6 +307,9 @@ export class MediaPlayer {
});
if (newTime === null) {
+ // invalidate in-flight video operations
+ this.videoAsyncId++;
+ this.nextFrame = null;
this.clearCanvas();
await this.cleanAudioIteratorAndNodes();
return;