dasha 4.4.6 → 4.4.8
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 +1 -1
- package/dist/index.mjs +2 -13
- package/package.json +15 -17
package/dist/index.d.mts
CHANGED
|
@@ -450,7 +450,7 @@ type SourceWithRootPath = Source & {
|
|
|
450
450
|
requestInit?: RequestInit;
|
|
451
451
|
};
|
|
452
452
|
_url?: string | URL | Request;
|
|
453
|
-
_read(start: number, end: number, minReadPosition: number, maxReadPosition: number): MaybePromise$1<ReadResult | null>;
|
|
453
|
+
_read?(start: number, end: number, minReadPosition: number, maxReadPosition: number): MaybePromise$1<ReadResult | null>;
|
|
454
454
|
};
|
|
455
455
|
type HlsSubtitleMediaTag = {
|
|
456
456
|
autoselect: boolean;
|
package/dist/index.mjs
CHANGED
|
@@ -2337,6 +2337,7 @@ const getRoleType = (roleValue) => {
|
|
|
2337
2337
|
const capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
2338
2338
|
return ROLE_TYPE[roleValue.split("-").map(capitalize).join("")];
|
|
2339
2339
|
};
|
|
2340
|
+
const getDashTrackName = (representation, adaptationSet) => representation.getAttribute("label") || representation.getAttribute("bitmovin:label") || adaptationSet.getAttribute("label") || adaptationSet.getAttribute("bitmovin:label");
|
|
2340
2341
|
const createDashTrack = (params) => {
|
|
2341
2342
|
const { adaptationSet, contentType, frameRate, isLive, mimeType, period, representation, timeShiftBufferDepth } = params;
|
|
2342
2343
|
const bitrate = params.bitrate;
|
|
@@ -2351,7 +2352,7 @@ const createDashTrack = (params) => {
|
|
|
2351
2352
|
codecString: descriptor.codecString,
|
|
2352
2353
|
peakBitrate: bitrate,
|
|
2353
2354
|
averageBitrate: bitrate,
|
|
2354
|
-
name:
|
|
2355
|
+
name: getDashTrackName(representation, adaptationSet),
|
|
2355
2356
|
default: false,
|
|
2356
2357
|
groupId: representation.getAttribute("id"),
|
|
2357
2358
|
periodId: period.getAttribute("id"),
|
|
@@ -2637,17 +2638,6 @@ const mergeDashPeriodTrack = (tracks, track, isLive) => {
|
|
|
2637
2638
|
}
|
|
2638
2639
|
lastSegment.duration += incomingSegments.reduce((sum, segment) => sum + segment.duration, 0);
|
|
2639
2640
|
};
|
|
2640
|
-
const linkDefaultDashGroups = (tracks) => {
|
|
2641
|
-
const audioList = tracks.filter((track) => track.type === "audio");
|
|
2642
|
-
const subtitleList = tracks.filter((track) => track.type === "subtitle");
|
|
2643
|
-
const videoList = tracks.filter((track) => track.type === "video");
|
|
2644
|
-
for (const video of videoList) {
|
|
2645
|
-
const audioGroupId = audioList.toSorted((a, b) => (b.peakBitrate || 0) - (a.peakBitrate || 0)).at(0)?.groupId;
|
|
2646
|
-
const subtitleGroupId = subtitleList.toSorted((a, b) => (b.peakBitrate || 0) - (a.peakBitrate || 0)).at(0)?.groupId;
|
|
2647
|
-
if (audioGroupId) video.audioGroupId = audioGroupId;
|
|
2648
|
-
if (subtitleGroupId) video.subtitleGroupId = subtitleGroupId;
|
|
2649
|
-
}
|
|
2650
|
-
};
|
|
2651
2641
|
var DashDemuxer = class {
|
|
2652
2642
|
input;
|
|
2653
2643
|
metadataPromise = null;
|
|
@@ -2707,7 +2697,6 @@ var DashDemuxer = class {
|
|
|
2707
2697
|
const manifest = this.parseManifest(rawText);
|
|
2708
2698
|
const tracks = [];
|
|
2709
2699
|
for (const period of getDirectDashChildren(manifest.mpdElement, "Period")) this.appendPeriodTracks(tracks, manifest, period);
|
|
2710
|
-
linkDefaultDashGroups(tracks);
|
|
2711
2700
|
return tracks;
|
|
2712
2701
|
}
|
|
2713
2702
|
parseManifest(rawText) {
|
package/package.json
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dasha",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.8",
|
|
4
4
|
"description": "Streaming manifest parser",
|
|
5
|
-
"packageManager": "pnpm@11.5.0",
|
|
6
5
|
"files": [
|
|
7
6
|
"dist"
|
|
8
7
|
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"test": "vitest",
|
|
11
|
-
"lint": "oxlint . && oxfmt --check .",
|
|
12
|
-
"fix": "oxlint . --fix && oxfmt --write .",
|
|
13
|
-
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
14
|
-
"build": "tsdown src/index.ts --format esm",
|
|
15
|
-
"prepublishOnly": "pnpm build"
|
|
16
|
-
},
|
|
17
8
|
"type": "module",
|
|
18
9
|
"main": "./dist/index.mjs",
|
|
19
10
|
"types": "./dist/index.d.mts",
|
|
@@ -61,14 +52,21 @@
|
|
|
61
52
|
"temporal-polyfill": "^0.3.2"
|
|
62
53
|
},
|
|
63
54
|
"peerDependencies": {
|
|
64
|
-
"mediabunny": "^1.
|
|
55
|
+
"mediabunny": "^1.48.0"
|
|
65
56
|
},
|
|
66
57
|
"devDependencies": {
|
|
67
|
-
"@types/node": "^
|
|
68
|
-
"oxfmt": "^0.
|
|
69
|
-
"oxlint": "^1.
|
|
70
|
-
"tsdown": "^0.22.
|
|
58
|
+
"@types/node": "^22.19.21",
|
|
59
|
+
"oxfmt": "^0.55.0",
|
|
60
|
+
"oxlint": "^1.70.0",
|
|
61
|
+
"tsdown": "^0.22.3",
|
|
71
62
|
"typescript": "^6.0.3",
|
|
72
|
-
"vitest": "^4.1.
|
|
63
|
+
"vitest": "^4.1.9"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"test": "vitest",
|
|
67
|
+
"lint": "oxlint . && oxfmt --check .",
|
|
68
|
+
"fix": "oxlint . --fix && oxfmt --write .",
|
|
69
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
70
|
+
"build": "tsdown src/index.ts --format esm"
|
|
73
71
|
}
|
|
74
|
-
}
|
|
72
|
+
}
|