Add AppendOnlyStreamSource, adjust examples to use it

This commit is contained in:
Vanilagy
2026-04-21 14:58:33 +02:00
parent 2b3e5f45c6
commit 783cfa6fbe
17 changed files with 328 additions and 68 deletions
+3 -3
View File
@@ -1225,7 +1225,7 @@ export class HlsMuxer extends Muxer {
isRoot: false,
mimeType: HLS_MIME_TYPE,
});
const writer = new Writer(target);
const writer = new Writer(target, true);
writer.start();
writer.write(textEncoder.encode(playlistText));
@@ -1426,7 +1426,7 @@ export class HlsMuxer extends Muxer {
if (this.numWrittenMasterPlaylists === 0) {
// For the first master playlist write, we use the normal root writer getter, so that the target
// returned by Output.target emits valid write events.
writer = await this.output._getRootWriter();
writer = await this.output._getRootWriter(true);
} else {
// For subsequent master playlist writes, we *must* obtain a different target in order to overwrite
// the file.
@@ -1435,7 +1435,7 @@ export class HlsMuxer extends Muxer {
isRoot: true,
mimeType: HLS_MIME_TYPE,
});
writer = new Writer(target);
writer = new Writer(target, true);
writer.start();
}