dasha 4.4.9 → 4.5.0
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 +19 -13
- package/dist/index.mjs +64 -22
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { AudioCodec as AudioCodec$1, DurationMetadataRequestOptions, EncodedPacket, FilePathSource, HLS, HLS_FORMATS, Input as Input$1, InputAudioTrack as InputAudioTrack$1, InputFormat, InputOptions, InputTrack as InputTrack$2, InputTrackQuery, InputTrackQuery as InputTrackQuery$1, InputVideoTrack as InputVideoTrack$1, MP3, MP4, MaybePromise, MaybePromise as MaybePromise$1, MediaCodec as MediaCodec$1, MetadataTags, PacketRetrievalOptions, PathedSource, Source, SourceRef, SubtitleCodec as SubtitleCodec$1, TrackDisposition, UrlSource, VideoCodec as VideoCodec$1, asc, desc, prefer } from "mediabunny";
|
|
2
|
-
|
|
1
|
+
import { AudioCodec as AudioCodec$1, DurationMetadataRequestOptions, EncodedPacket, FilePathSource, HLS, HLS_FORMATS, Input as Input$1, InputAudioTrack as InputAudioTrack$1, InputFormat, InputOptions, InputTrack as InputTrack$2, InputTrackQuery, InputTrackQuery as InputTrackQuery$1, InputVideoTrack as InputVideoTrack$1, MP3, MP4, MaybePromise, MaybePromise as MaybePromise$1, MediaCodec as MediaCodec$1, MetadataTags, PacketRetrievalOptions, PathedSource, Source, SourceRef, SubtitleCodec as SubtitleCodec$1, TrackDisposition, TransformationMatrix, UrlSource, VideoCodec as VideoCodec$1, asc, desc, prefer } from "mediabunny";
|
|
3
2
|
//#region src/mediabunny.d.ts
|
|
4
3
|
type Segment$1 = {
|
|
5
4
|
timestamp: number;
|
|
@@ -411,7 +410,7 @@ declare class DashInputVideoTrackBacking extends DashTrackBackingBase {
|
|
|
411
410
|
getSquarePixelHeight(): number | Promise<any>;
|
|
412
411
|
getMetadataDisplayWidth(): number | null;
|
|
413
412
|
getMetadataDisplayHeight(): number | null;
|
|
414
|
-
|
|
413
|
+
getTransformationMatrix(): TransformationMatrix;
|
|
415
414
|
getColorSpace(): Promise<VideoColorSpaceInit>;
|
|
416
415
|
canBeTransparent(): Promise<any>;
|
|
417
416
|
}
|
|
@@ -435,13 +434,14 @@ declare class DashInputFormat extends InputFormat {
|
|
|
435
434
|
_canReadInput(input: Input$1): Promise<boolean>;
|
|
436
435
|
_createDemuxer(input: Input$1): DashDemuxer;
|
|
437
436
|
}
|
|
438
|
-
declare const DASH: DashInputFormat;
|
|
439
|
-
declare const DASH_FORMATS: InputFormat[];
|
|
437
|
+
export declare const DASH: DashInputFormat;
|
|
438
|
+
export declare const DASH_FORMATS: InputFormat[];
|
|
440
439
|
//#endregion
|
|
441
440
|
//#region src/hls/hls-subtitles.d.ts
|
|
442
441
|
type ReadResult = {
|
|
443
442
|
bytes: Uint8Array;
|
|
444
|
-
view: DataView;
|
|
443
|
+
view: DataView;
|
|
444
|
+
/** The offset of the bytes in the file. */
|
|
445
445
|
offset: number;
|
|
446
446
|
};
|
|
447
447
|
type SourceWithRootPath = Source & {
|
|
@@ -600,6 +600,10 @@ type InputAudioTracksOptions = {
|
|
|
600
600
|
formats?: readonly InputFormat[];
|
|
601
601
|
pairWith?: InputAudioTrackPairing;
|
|
602
602
|
sortBy?: InputTrackQuery$1<InputAudioTrack>['sortBy'];
|
|
603
|
+
/** Marks the imported tracks as audio description tracks. */
|
|
604
|
+
visuallyImpaired?: boolean;
|
|
605
|
+
/** Overrides the track name (e.g. "Audio Description" for tracks imported from a separate manifest). */
|
|
606
|
+
name?: string | null;
|
|
603
607
|
};
|
|
604
608
|
type SegmentableBacking = {
|
|
605
609
|
getId(): number;
|
|
@@ -635,6 +639,8 @@ declare class ImportedAudioTrackBacking {
|
|
|
635
639
|
id: number;
|
|
636
640
|
number: number;
|
|
637
641
|
source: Source;
|
|
642
|
+
visuallyImpaired?: boolean;
|
|
643
|
+
name?: string | null;
|
|
638
644
|
});
|
|
639
645
|
getType(): string;
|
|
640
646
|
getId(): number;
|
|
@@ -645,7 +651,7 @@ declare class ImportedAudioTrackBacking {
|
|
|
645
651
|
getLanguageCode(): string | Promise<string>;
|
|
646
652
|
getTimeResolution(): number | Promise<number>;
|
|
647
653
|
isRelativeToUnixEpoch(): boolean | Promise<boolean>;
|
|
648
|
-
getDisposition():
|
|
654
|
+
getDisposition(): Record<string, boolean>;
|
|
649
655
|
getPairingMask(): bigint;
|
|
650
656
|
getSource(): Source;
|
|
651
657
|
getBitrate(): number | Promise<number | null> | null;
|
|
@@ -664,7 +670,7 @@ declare class ImportedAudioTrackBacking {
|
|
|
664
670
|
getNextKeyPacket(packet: EncodedPacket, options: unknown): Promise<EncodedPacket | null>;
|
|
665
671
|
getSegmentedInput(): any;
|
|
666
672
|
}
|
|
667
|
-
declare const preserveSubtitleBackingsOnInput: (input: Input$1) => Input$1<Source>;
|
|
673
|
+
export declare const preserveSubtitleBackingsOnInput: (input: Input$1) => Input$1<Source>;
|
|
668
674
|
declare class SegmentedMediabunnyInput<S extends Source = Source> extends Input$1<S> {
|
|
669
675
|
#private;
|
|
670
676
|
_wrapBackingAsTrack(backing: TrackBacking): InputTrack$1;
|
|
@@ -684,12 +690,12 @@ declare class SegmentedMediabunnyInput<S extends Source = Source> extends Input$
|
|
|
684
690
|
type DashaInputOptions<S extends Source = Source> = Omit<InputOptions<S>, 'formats'> & {
|
|
685
691
|
formats: readonly InputFormat[];
|
|
686
692
|
};
|
|
687
|
-
type InputSegment = HlsSegment | DashSegment;
|
|
688
|
-
type InputSegmentedInput = HlsSegmentedInput | DashSegmentedInput;
|
|
689
|
-
declare class Input<S extends Source = Source> extends SegmentedMediabunnyInput<S> {
|
|
693
|
+
export type InputSegment = HlsSegment | DashSegment;
|
|
694
|
+
export type InputSegmentedInput = HlsSegmentedInput | DashSegmentedInput;
|
|
695
|
+
export declare class Input<S extends Source = Source> extends SegmentedMediabunnyInput<S> {
|
|
690
696
|
constructor(options: DashaInputOptions<S>);
|
|
691
697
|
}
|
|
692
|
-
declare const isInput: (value: unknown) => value is Input;
|
|
698
|
+
export declare const isInput: (value: unknown) => value is Input;
|
|
693
699
|
declare const ALL_FORMATS: InputFormat[];
|
|
694
700
|
//#endregion
|
|
695
|
-
export { ALL_FORMATS, type AudioCodec,
|
|
701
|
+
export { ALL_FORMATS, type AudioCodec, type DashSegment, type DashSegmentedInput, FilePathSource, HLS, HLS_FORMATS, type HlsSegment, type HlsSegmentedInput, type InputAudioSource, type InputAudioTrack, type InputAudioTrackPairing, type InputAudioTracksOptions, type InputSubtitleSource, type InputSubtitleTrack, type InputSubtitleTrackMetadata, type InputTrack$1 as InputTrack, type InputTrackQuery, type InputTrackWithBacking, type InputVideoTrack, MP3, MP4, type MaybePromise, type MediaCodec, type SubtitleCodec, UrlSource, type VideoCodec, type VideoDynamicRange, asc, desc, prefer };
|
package/dist/index.mjs
CHANGED
|
@@ -164,20 +164,20 @@ const DOLBY_VISION_CODECS = [
|
|
|
164
164
|
"dvhe",
|
|
165
165
|
"dvh1"
|
|
166
166
|
];
|
|
167
|
-
const COLOR_PRIMARIES_MAP = new Map([
|
|
167
|
+
const COLOR_PRIMARIES_MAP = /* @__PURE__ */ new Map([
|
|
168
168
|
[PRIMARIES.BT_709, "bt709"],
|
|
169
169
|
[PRIMARIES.BT_601_625, "bt470bg"],
|
|
170
170
|
[PRIMARIES.BT_601_525, "smpte170m"],
|
|
171
171
|
[PRIMARIES.BT_2020_and_2100, "bt2020"],
|
|
172
172
|
[PRIMARIES.SMPTE_ST_2113_and_EG_4321, "smpte432"]
|
|
173
173
|
]);
|
|
174
|
-
const TRANSFER_CHARACTERISTICS_MAP = new Map([
|
|
174
|
+
const TRANSFER_CHARACTERISTICS_MAP = /* @__PURE__ */ new Map([
|
|
175
175
|
[TRANSFER.BT_709, "bt709"],
|
|
176
176
|
[TRANSFER.BT_601, "smpte170m"],
|
|
177
177
|
[TRANSFER.BT_2100_PQ, "pq"],
|
|
178
178
|
[TRANSFER.BT_2100_HLG, "hlg"]
|
|
179
179
|
]);
|
|
180
|
-
const MATRIX_COEFFICIENTS_MAP = new Map([
|
|
180
|
+
const MATRIX_COEFFICIENTS_MAP = /* @__PURE__ */ new Map([
|
|
181
181
|
[MATRIX.RGB, "rgb"],
|
|
182
182
|
[MATRIX.YCbCr_BT_709, "bt709"],
|
|
183
183
|
[MATRIX.YCbCr_BT_601_625, "bt470bg"],
|
|
@@ -339,7 +339,8 @@ const normalizeHeaders$1 = (headers) => {
|
|
|
339
339
|
};
|
|
340
340
|
const getSourceHeaders$1 = (source) => {
|
|
341
341
|
const requestHeaders = "_url" in source && source._url instanceof Request ? normalizeHeaders$1(source._url.headers) : {};
|
|
342
|
-
const
|
|
342
|
+
const options = "_options" in source && source._options && typeof source._options === "object" ? source._options : void 0;
|
|
343
|
+
const optionHeaders = normalizeHeaders$1(options?.requestInit?.headers);
|
|
343
344
|
return {
|
|
344
345
|
...requestHeaders,
|
|
345
346
|
...optionHeaders
|
|
@@ -373,7 +374,8 @@ const loadDashManifest = async (source) => {
|
|
|
373
374
|
};
|
|
374
375
|
}
|
|
375
376
|
if (resolvedManifestPath.startsWith("file:")) {
|
|
376
|
-
const
|
|
377
|
+
const filePath = new URL(resolvedManifestPath);
|
|
378
|
+
const text = await readFile(filePath, "utf8");
|
|
377
379
|
return {
|
|
378
380
|
text,
|
|
379
381
|
url: parseOriginalUrlFromManifest(text) ?? resolvedManifestPath
|
|
@@ -690,7 +692,8 @@ const detectSubtitleCodecFromUri = async (source, uri) => {
|
|
|
690
692
|
const segmentUri = joinHlsPath(loaded.path, line);
|
|
691
693
|
const fromSegmentPath = parseDetectedSubtitleCodec(inferSubtitleCodecStringFromPath(segmentUri));
|
|
692
694
|
if (fromSegmentPath) return fromSegmentPath;
|
|
693
|
-
const
|
|
695
|
+
const loadedSegment = await loadPlaylistText(source, segmentUri);
|
|
696
|
+
const fromSegmentText = parseDetectedSubtitleCodec(sniffSubtitleCodecFromText(loadedSegment.text));
|
|
694
697
|
if (fromSegmentText) return fromSegmentText;
|
|
695
698
|
continue;
|
|
696
699
|
}
|
|
@@ -719,7 +722,7 @@ const parseMediaRange = (value) => {
|
|
|
719
722
|
const parseHexIv = (value) => {
|
|
720
723
|
if (!IV_STRING_REGEX.test(value)) throw new Error(`Unsupported IV format '${value}'.`);
|
|
721
724
|
let hex = value.slice(2);
|
|
722
|
-
hex = hex.padStart(
|
|
725
|
+
hex = hex.padStart(32, "0");
|
|
723
726
|
const iv = new Uint8Array(AES_128_BLOCK_SIZE);
|
|
724
727
|
for (let index = 0; index < AES_128_BLOCK_SIZE; index++) {
|
|
725
728
|
const startIndex = index * 2;
|
|
@@ -1429,7 +1432,8 @@ const BASE_INPUT_PATCHED = Symbol.for("dasha.base-mediabunny-input-patched");
|
|
|
1429
1432
|
const PRESERVE_SUBTITLE_BACKINGS = Symbol.for("dasha.preserve-subtitle-backings");
|
|
1430
1433
|
const resolvedHlsSegmentLocations = /* @__PURE__ */ new WeakSet();
|
|
1431
1434
|
const getDefaultAudioTrackFormats = (source) => {
|
|
1432
|
-
|
|
1435
|
+
const rawSource = source instanceof SourceRef ? source.source : source;
|
|
1436
|
+
return isLikelyDashPath(rawSource) ? [DASH, ...ALL_FORMATS$1] : [...ALL_FORMATS$1, DASH];
|
|
1433
1437
|
};
|
|
1434
1438
|
var WholeResourceAudioSegmentedInput = class {
|
|
1435
1439
|
segments = [];
|
|
@@ -1465,12 +1469,16 @@ var ImportedAudioTrackBacking = class {
|
|
|
1465
1469
|
#id;
|
|
1466
1470
|
#number;
|
|
1467
1471
|
#source;
|
|
1472
|
+
#visuallyImpaired;
|
|
1473
|
+
#name;
|
|
1468
1474
|
#wholeResourceSegmentedInput;
|
|
1469
1475
|
constructor(params) {
|
|
1470
1476
|
this.#backing = params.backing;
|
|
1471
1477
|
this.#id = params.id;
|
|
1472
1478
|
this.#number = params.number;
|
|
1473
1479
|
this.#source = params.source;
|
|
1480
|
+
this.#visuallyImpaired = params.visuallyImpaired;
|
|
1481
|
+
this.#name = params.name;
|
|
1474
1482
|
this.#wholeResourceSegmentedInput = new WholeResourceAudioSegmentedInput(params.source);
|
|
1475
1483
|
}
|
|
1476
1484
|
getType() {
|
|
@@ -1489,7 +1497,7 @@ var ImportedAudioTrackBacking = class {
|
|
|
1489
1497
|
return this.#backing.getInternalCodecId?.() ?? null;
|
|
1490
1498
|
}
|
|
1491
1499
|
getName() {
|
|
1492
|
-
return this.#backing.getName?.() ?? null;
|
|
1500
|
+
return this.#name ?? this.#backing.getName?.() ?? null;
|
|
1493
1501
|
}
|
|
1494
1502
|
getLanguageCode() {
|
|
1495
1503
|
return this.#backing.getLanguageCode?.() ?? "und";
|
|
@@ -1501,7 +1509,12 @@ var ImportedAudioTrackBacking = class {
|
|
|
1501
1509
|
return this.#backing.isRelativeToUnixEpoch?.() ?? false;
|
|
1502
1510
|
}
|
|
1503
1511
|
getDisposition() {
|
|
1504
|
-
|
|
1512
|
+
const disposition = this.#backing.getDisposition?.() ?? {};
|
|
1513
|
+
if (this.#visuallyImpaired === void 0) return disposition;
|
|
1514
|
+
return {
|
|
1515
|
+
...disposition,
|
|
1516
|
+
visuallyImpaired: this.#visuallyImpaired
|
|
1517
|
+
};
|
|
1505
1518
|
}
|
|
1506
1519
|
getPairingMask() {
|
|
1507
1520
|
return 0n;
|
|
@@ -1561,7 +1574,8 @@ var ImportedAudioTrackBacking = class {
|
|
|
1561
1574
|
};
|
|
1562
1575
|
const getBackingType = (backing) => backing.getType?.();
|
|
1563
1576
|
const queryWrappedTracks = (input, backings, query) => {
|
|
1564
|
-
|
|
1577
|
+
const tracks = backings.map((backing) => input._wrapBackingAsTrack(backing));
|
|
1578
|
+
return queryTracks(tracks, query);
|
|
1565
1579
|
};
|
|
1566
1580
|
const getTrackBackingsByType = async (input, type) => {
|
|
1567
1581
|
const nativeBackings = await input._getTrackBackings();
|
|
@@ -1615,7 +1629,8 @@ const getTrackMetadataOverrides = (backing) => backing[TRACK_METADATA_OVERRIDES]
|
|
|
1615
1629
|
const ensureLanguageCodeOverridePatch = (backing) => {
|
|
1616
1630
|
const patchedBacking = backing;
|
|
1617
1631
|
if (patchedBacking[ORIGINAL_GET_LANGUAGE_CODE]) return patchedBacking;
|
|
1618
|
-
|
|
1632
|
+
const originalGetLanguageCode = backing.getLanguageCode?.bind(backing) ?? (() => "und");
|
|
1633
|
+
patchedBacking[ORIGINAL_GET_LANGUAGE_CODE] = originalGetLanguageCode;
|
|
1619
1634
|
Object.assign(backing, { getLanguageCode: () => getTrackMetadataOverrides(patchedBacking).languageCode ?? patchedBacking[ORIGINAL_GET_LANGUAGE_CODE]?.() ?? "und" });
|
|
1620
1635
|
return patchedBacking;
|
|
1621
1636
|
};
|
|
@@ -1693,7 +1708,8 @@ var SegmentedMediabunnyInput = class SegmentedMediabunnyInput extends Input$1 {
|
|
|
1693
1708
|
#nextPairingBitIndex = null;
|
|
1694
1709
|
async #queryTracks(query, type) {
|
|
1695
1710
|
const internalInput = this;
|
|
1696
|
-
|
|
1711
|
+
const backings = await getTrackBackingsByType(internalInput, type);
|
|
1712
|
+
return queryWrappedTracks(internalInput, backings, query);
|
|
1697
1713
|
}
|
|
1698
1714
|
_wrapBackingAsTrack(backing) {
|
|
1699
1715
|
const track = backing.getType?.() === "subtitle" ? this.#wrapSubtitleBacking(backing) : super._wrapBackingAsTrack(backing);
|
|
@@ -1783,7 +1799,9 @@ var SegmentedMediabunnyInput = class SegmentedMediabunnyInput extends Input$1 {
|
|
|
1783
1799
|
id: this.#nextCustomAudioTrackId++,
|
|
1784
1800
|
number: this.#nextCustomAudioTrackNumber++,
|
|
1785
1801
|
backing: getTrackBacking(audioTrack),
|
|
1786
|
-
source: audioInput.source
|
|
1802
|
+
source: audioInput.source,
|
|
1803
|
+
visuallyImpaired: options.visuallyImpaired,
|
|
1804
|
+
name: options.name
|
|
1787
1805
|
});
|
|
1788
1806
|
this.#pairAudioBacking(backing, pairWith);
|
|
1789
1807
|
this.#customAudioBackings.push(backing);
|
|
@@ -1856,7 +1874,8 @@ var SegmentedMediabunnyInput = class SegmentedMediabunnyInput extends Input$1 {
|
|
|
1856
1874
|
const patchedBacking = backing;
|
|
1857
1875
|
patchedBacking[EXTRA_PAIRING_MASK] = (patchedBacking[EXTRA_PAIRING_MASK] ?? 0n) | mask;
|
|
1858
1876
|
if (patchedBacking[ORIGINAL_GET_PAIRING_MASK]) return;
|
|
1859
|
-
|
|
1877
|
+
const originalGetPairingMask = backing.getPairingMask?.bind(backing) ?? (() => 0n);
|
|
1878
|
+
patchedBacking[ORIGINAL_GET_PAIRING_MASK] = originalGetPairingMask;
|
|
1860
1879
|
Object.assign(backing, { getPairingMask: () => (patchedBacking[ORIGINAL_GET_PAIRING_MASK]?.() ?? 0n) | (patchedBacking[EXTRA_PAIRING_MASK] ?? 0n) });
|
|
1861
1880
|
}
|
|
1862
1881
|
dispose() {
|
|
@@ -1869,6 +1888,7 @@ var SegmentedMediabunnyInput = class SegmentedMediabunnyInput extends Input$1 {
|
|
|
1869
1888
|
//#endregion
|
|
1870
1889
|
//#region src/dash/dash-segmented-input.ts
|
|
1871
1890
|
const roundToDivisor = (value, multiple) => Math.round(value * multiple) / multiple;
|
|
1891
|
+
const isEncryptedSamplesError = (error) => error instanceof Error && error.message.startsWith("Encrypted media samples encountered");
|
|
1872
1892
|
const binarySearchLessOrEqual = (array, value, getValue) => {
|
|
1873
1893
|
let left = 0;
|
|
1874
1894
|
let right = array.length - 1;
|
|
@@ -2133,7 +2153,12 @@ var DashSegmentedInput = class {
|
|
|
2133
2153
|
if (!firstSegment) return null;
|
|
2134
2154
|
const track = await this.getTrackForSegment(firstSegment);
|
|
2135
2155
|
if (!track) return null;
|
|
2136
|
-
|
|
2156
|
+
let packet = null;
|
|
2157
|
+
try {
|
|
2158
|
+
packet = await track._backing.getFirstPacket(options);
|
|
2159
|
+
} catch (error) {
|
|
2160
|
+
if (!isEncryptedSamplesError(error)) throw error;
|
|
2161
|
+
}
|
|
2137
2162
|
if (!packet) return null;
|
|
2138
2163
|
return this.createAdjustedPacket(packet, firstSegment, track);
|
|
2139
2164
|
}
|
|
@@ -2182,7 +2207,12 @@ var DashSegmentedInput = class {
|
|
|
2182
2207
|
}
|
|
2183
2208
|
const input = track.input;
|
|
2184
2209
|
const offsetTimestamp = timestamp - await this.getMediaOffset(currentSegment, input, track);
|
|
2185
|
-
|
|
2210
|
+
let packet = null;
|
|
2211
|
+
try {
|
|
2212
|
+
packet = keyframesOnly ? await track._backing.getKeyPacket(offsetTimestamp, options) : await track._backing.getPacket(offsetTimestamp, options);
|
|
2213
|
+
} catch (error) {
|
|
2214
|
+
if (!keyframesOnly || !isEncryptedSamplesError(error)) throw error;
|
|
2215
|
+
}
|
|
2186
2216
|
if (!packet) {
|
|
2187
2217
|
currentSegment = await this.getPreviousSegment(currentSegment);
|
|
2188
2218
|
continue;
|
|
@@ -2198,7 +2228,7 @@ var DashSegmentedInput = class {
|
|
|
2198
2228
|
};
|
|
2199
2229
|
//#endregion
|
|
2200
2230
|
//#region src/dash/dash-demuxer.ts
|
|
2201
|
-
const DASH_NAMESPACE_MAP = new Map([
|
|
2231
|
+
const DASH_NAMESPACE_MAP = /* @__PURE__ */ new Map([
|
|
2202
2232
|
["cenc", "urn:mpeg:cenc:2013"],
|
|
2203
2233
|
["mspr", "urn:microsoft:playready"],
|
|
2204
2234
|
["mas", "urn:marlin:mas:1-0:services:schemas:mpd"]
|
|
@@ -2222,7 +2252,8 @@ const replaceFirst = (source, oldValue, newValue) => {
|
|
|
2222
2252
|
const processDashContent = (mpdContent) => {
|
|
2223
2253
|
const missingNamespaceKeys = Array.from(DASH_NAMESPACE_MAP.keys().filter((key) => isMissingNamespace(mpdContent, key)));
|
|
2224
2254
|
if (!missingNamespaceKeys.length) return mpdContent;
|
|
2225
|
-
|
|
2255
|
+
const missingNamespaceDefinitions = missingNamespaceKeys.map((key) => `xmlns:${key}="${DASH_NAMESPACE_MAP.get(key)}"`);
|
|
2256
|
+
return replaceFirst(mpdContent, "<MPD ", `<MPD ${missingNamespaceDefinitions.join(" ")} `);
|
|
2226
2257
|
};
|
|
2227
2258
|
const getDashRefreshIntervalMs = (timeShiftBufferDepth) => Temporal.Duration.from(timeShiftBufferDepth).total("milliseconds") / 2;
|
|
2228
2259
|
const getDisposition = (track) => ({
|
|
@@ -2335,7 +2366,8 @@ const getSegmentTimelineEntries = (timeline, timescale, limit) => {
|
|
|
2335
2366
|
};
|
|
2336
2367
|
const getRoleType = (roleValue) => {
|
|
2337
2368
|
const capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
2338
|
-
|
|
2369
|
+
const roleTypeKey = roleValue.split("-").map(capitalize).join("");
|
|
2370
|
+
return ROLE_TYPE[roleTypeKey];
|
|
2339
2371
|
};
|
|
2340
2372
|
const getDashTrackName = (representation, adaptationSet) => representation.getAttribute("label") || representation.getAttribute("bitmovin:label") || adaptationSet.getAttribute("label") || adaptationSet.getAttribute("bitmovin:label");
|
|
2341
2373
|
const createDashTrack = (params) => {
|
|
@@ -2981,8 +3013,18 @@ var DashInputVideoTrackBacking = class extends DashTrackBackingBase {
|
|
|
2981
3013
|
getMetadataDisplayHeight() {
|
|
2982
3014
|
return this.internalTrack.info.height;
|
|
2983
3015
|
}
|
|
2984
|
-
|
|
2985
|
-
return
|
|
3016
|
+
getTransformationMatrix() {
|
|
3017
|
+
return [
|
|
3018
|
+
1,
|
|
3019
|
+
0,
|
|
3020
|
+
0,
|
|
3021
|
+
0,
|
|
3022
|
+
1,
|
|
3023
|
+
0,
|
|
3024
|
+
0,
|
|
3025
|
+
0,
|
|
3026
|
+
1
|
|
3027
|
+
];
|
|
2986
3028
|
}
|
|
2987
3029
|
async getColorSpace() {
|
|
2988
3030
|
return this.internalTrack.track.colorSpace ?? this.delegate((track) => track.getColorSpace());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dasha",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "Streaming manifest parser",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -48,19 +48,19 @@
|
|
|
48
48
|
"node": ">=22.19"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@xmldom/xmldom": "^0.9.
|
|
52
|
-
"temporal-polyfill": "^0.
|
|
51
|
+
"@xmldom/xmldom": "^0.9.12",
|
|
52
|
+
"temporal-polyfill": "^1.0.5"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"mediabunny": "^1.
|
|
55
|
+
"mediabunny": "^1.58.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/node": "^22.19.21",
|
|
59
|
-
"oxfmt": "^0.
|
|
60
|
-
"oxlint": "^1.
|
|
61
|
-
"tsdown": "^0.
|
|
59
|
+
"oxfmt": "^0.68.0",
|
|
60
|
+
"oxlint": "^1.83.0",
|
|
61
|
+
"tsdown": "^0.23.0",
|
|
62
62
|
"typescript": "^6.0.3",
|
|
63
|
-
"vitest": "^
|
|
63
|
+
"vitest": "^5.0.1"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"test": "vitest",
|