Fix sample closing before it reaches the custom encoder

This commit is contained in:
Vanilagy
2025-08-12 15:36:17 +02:00
parent 7e89511ca6
commit 7e546c2cc7
6 changed files with 36 additions and 34 deletions
+2
View File
@@ -123,6 +123,7 @@ const sampleSource = new VideoSampleSource({
});
await sampleSource.add(videoSample);
videoSample.close(); // If it's not needed anymore
// You may optionally force samples to be encoded as key frames:
await sampleSource.add(videoSample, { keyFrame: true });
@@ -285,6 +286,7 @@ const sampleSource = new AudioSampleSource({
});
await sampleSource.add(audioSample);
audioSample.close(); // If it's not needed anymore
```
### `AudioBufferSource`