dasha 4.4.1 → 4.4.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/dist/index.d.mts CHANGED
@@ -610,6 +610,7 @@ type SegmentableBacking = {
610
610
  getDecoderConfig?(): Promise<VideoDecoderConfig | AudioDecoderConfig | null>;
611
611
  getMetadataCodecParameterString?(): string | null | Promise<string | null>;
612
612
  getSegmentedInput?(): HlsSegmentedInput | DashSegmentedInput;
613
+ segmentedInput?: HlsSegmentedInput;
613
614
  getSource?(): Source;
614
615
  };
615
616
  type NativeTrackBacking = SegmentableBacking;
package/dist/index.mjs CHANGED
@@ -330,12 +330,15 @@ const getSourceHeaders$1 = (source) => {
330
330
  ...optionHeaders
331
331
  };
332
332
  };
333
+ const getSourceFetch = (source) => {
334
+ return ("_options" in source && source._options && typeof source._options === "object" ? source._options : void 0)?.fetchFn ?? fetch;
335
+ };
333
336
  const parseOriginalUrlFromManifest = (text) => text.match(/<!--\s*URL:\s*([^\n]+?)\s*-->/)?.[1]?.trim();
334
337
  const loadDashManifest = async (source) => {
335
338
  const manifestPath = getSourcePath(source);
336
339
  if (!manifestPath) throw new Error("DASH input currently requires a pathed source such as UrlSource.");
337
340
  if (manifestPath.startsWith("http://") || manifestPath.startsWith("https://")) {
338
- const response = await fetch(manifestPath, { headers: getSourceHeaders$1(source) });
341
+ const response = await getSourceFetch(source)(manifestPath, { headers: getSourceHeaders$1(source) });
339
342
  if (!response.ok) throw new Error(`Failed to fetch DASH manifest: ${response.status} ${response.statusText} (${response.url})`);
340
343
  return {
341
344
  text: await response.text(),
@@ -1508,6 +1511,7 @@ var ImportedAudioTrackBacking = class {
1508
1511
  }
1509
1512
  getSegmentedInput() {
1510
1513
  if (this.#backing.getSegmentedInput) return this.#backing.getSegmentedInput();
1514
+ if (this.#backing.segmentedInput) return this.#backing.segmentedInput;
1511
1515
  const hlsBacking = this.#backing;
1512
1516
  if (hlsBacking.internalTrack?.demuxer?.getSegmentedInputForPath) return hlsBacking.internalTrack.demuxer.getSegmentedInputForPath(hlsBacking.internalTrack.fullPath);
1513
1517
  return this.#wholeResourceSegmentedInput;
@@ -1541,6 +1545,7 @@ const patchBaseMediabunnyInput = () => {
1541
1545
  const getSegmentedInputForTrack = (track) => {
1542
1546
  const backing = getTrackBacking(track);
1543
1547
  if ("getSegmentedInput" in backing && typeof backing.getSegmentedInput === "function") return backing.getSegmentedInput();
1548
+ if ("segmentedInput" in backing && backing.segmentedInput) return backing.segmentedInput;
1544
1549
  const internalTrack = backing.internalTrack;
1545
1550
  return internalTrack.demuxer.getSegmentedInputForPath(internalTrack.fullPath);
1546
1551
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dasha",
3
- "version": "4.4.1",
3
+ "version": "4.4.3",
4
4
  "description": "Streaming manifest parser",
5
5
  "files": [
6
6
  "dist"