mediabunny 1.52.2 → 1.52.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -130,7 +130,7 @@ const { title, artist, album } = await input.getMetadataTags();
130
130
  ### Create new media files
131
131
 
132
132
  ```js
133
- import { Output, Mp4OutputFormat, BufferTarget, CanvasSource, QUALITY_HIGH } from 'mediabunny';
133
+ import { Output, Mp4OutputFormat, BufferTarget, CanvasSource, Quality } from 'mediabunny';
134
134
 
135
135
  const output = new Output({
136
136
  format: new Mp4OutputFormat(),
@@ -140,7 +140,7 @@ const output = new Output({
140
140
  // Add a video track backed by a canvas element
141
141
  const videoSource = new CanvasSource(canvas, {
142
142
  codec: 'avc',
143
- bitrate: QUALITY_HIGH,
143
+ bitrate: new Quality('high'),
144
144
  });
145
145
  output.addVideoTrack(videoSource);
146
146
 
@@ -27192,6 +27192,7 @@ var Mediabunny = (() => {
27192
27192
  if (trackData.track.metadata.disposition?.default !== false) {
27193
27193
  flags |= 1;
27194
27194
  }
27195
+ const alternateGroup = trackData.type === "video" ? 0 : trackData.type === "audio" ? 1 : trackData.type === "subtitle" ? 2 : assertNever(trackData);
27195
27196
  return fullBox("tkhd", +needsU64, flags, [
27196
27197
  u32OrU64(creationTime),
27197
27198
  // Creation time
@@ -27207,7 +27208,7 @@ var Mediabunny = (() => {
27207
27208
  // Reserved
27208
27209
  u16(0),
27209
27210
  // Layer
27210
- u16(trackData.track.id),
27211
+ u16(alternateGroup),
27211
27212
  // Alternate group
27212
27213
  fixed_8_8(trackData.type === "audio" ? 1 : 0),
27213
27214
  // Volume
@@ -37063,13 +37064,13 @@ ${cue.notes ?? ""}`;
37063
37064
  }
37064
37065
  return this._startPromise = (async () => {
37065
37066
  this.state = "started";
37066
- const release = await this._mutex.acquire();
37067
+ const releasePromise = this._mutex.acquire();
37067
37068
  try {
37068
37069
  await this._muxer.start();
37069
37070
  const promises = this.tracks.map((track) => track.source._start());
37070
37071
  await Promise.all(promises);
37071
37072
  } finally {
37072
- release();
37073
+ (await releasePromise)();
37073
37074
  }
37074
37075
  })();
37075
37076
  }