mediabunny 1.0.0 → 1.0.1

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
@@ -8,7 +8,7 @@
8
8
  <img src="./docs/public/mediabunny-logo.svg" height="180">
9
9
  </div>
10
10
 
11
- Mediabunny is a JavaScript library for reading, writing, and converting media files (like MP4 or WebM), directly in the browser. It aims to be a complete toolkit for high-performance media operations on the web. It's written from scratch in pure TypeScript, has zero dependencies, is very performant, and is extremely tree-shakable, meaning you only include what you use. You can think of it a bit like [FFmpeg](https://ffmpeg.org/), but built from the ground up for the web.
11
+ Mediabunny is a JavaScript library for reading, writing, and converting media files (like MP4, WebM, MP3), directly in the browser. It aims to be a complete toolkit for high-performance media operations on the web. It's written from scratch in pure TypeScript, has zero dependencies, is very performant, and is extremely tree-shakable, meaning you only include what you use. You can think of it a bit like [FFmpeg](https://ffmpeg.org/), but built from the ground up for the web.
12
12
 
13
13
  [Documentation](https://mediabunny.dev) | [Examples](https://mediabunny.dev/examples) | [Sponsoring](#sponsoring) | [License](#license) | [Discord](https://discord.gg/hmpkyYuS4U)
14
14
 
@@ -213,14 +213,18 @@ var Mediabunny = (() => {
213
213
  }
214
214
  };
215
215
  var toUint8Array = (source) => {
216
- if (source instanceof ArrayBuffer) {
216
+ if (source instanceof Uint8Array) {
217
+ return source;
218
+ } else if (source instanceof ArrayBuffer) {
217
219
  return new Uint8Array(source);
218
220
  } else {
219
221
  return new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
220
222
  }
221
223
  };
222
224
  var toDataView = (source) => {
223
- if (source instanceof ArrayBuffer) {
225
+ if (source instanceof DataView) {
226
+ return source;
227
+ } else if (source instanceof ArrayBuffer) {
224
228
  return new DataView(source);
225
229
  } else {
226
230
  return new DataView(source.buffer, source.byteOffset, source.byteLength);
@@ -275,7 +279,7 @@ var Mediabunny = (() => {
275
279
  return !!colorSpace && !!colorSpace.primaries && !!colorSpace.transfer && !!colorSpace.matrix && colorSpace.fullRange !== void 0;
276
280
  };
277
281
  var isAllowSharedBufferSource = (x) => {
278
- return x instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && x instanceof SharedArrayBuffer || ArrayBuffer.isView(x) && !(x instanceof DataView);
282
+ return x instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && x instanceof SharedArrayBuffer || ArrayBuffer.isView(x);
279
283
  };
280
284
  var AsyncMutex = class {
281
285
  constructor() {
@@ -7748,7 +7752,7 @@ ${cue.notes ?? ""}`;
7748
7752
  });
7749
7753
  } else {
7750
7754
  const data = new ArrayBuffer(this.allocationSize({ planeIndex: 0, format: this.format }));
7751
- this.copyTo(new DataView(data), { planeIndex: 0, format: this.format });
7755
+ this.copyTo(data, { planeIndex: 0, format: this.format });
7752
7756
  return new AudioData({
7753
7757
  format: this.format,
7754
7758
  sampleRate: this.sampleRate,