dasha 4.4.2 → 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.mjs +4 -1
- package/package.json +1 -1
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
|
|
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(),
|