dasha 4.4.0 → 4.4.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/dist/index.d.mts +9 -4
- package/dist/index.mjs +9 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -561,16 +561,19 @@ type SegmentAccessMethods = {
|
|
|
561
561
|
type TrackMetadataOverrideMethods = {
|
|
562
562
|
setLanguageCode(value: string): void;
|
|
563
563
|
};
|
|
564
|
+
type TrackSourceMethods = {
|
|
565
|
+
readonly source: Source;
|
|
566
|
+
};
|
|
564
567
|
type VideoDynamicRangeMethods = {
|
|
565
568
|
getDynamicRange(): Promise<VideoDynamicRange>;
|
|
566
569
|
};
|
|
567
570
|
type MediabunnySubtitleTrackLike = InputTrack$2 & {
|
|
568
571
|
type: 'subtitle';
|
|
569
572
|
};
|
|
570
|
-
type InputTrack$1 = InputTrack$2 & SegmentAccessMethods & TrackMetadataOverrideMethods;
|
|
571
|
-
type InputVideoTrack = InputVideoTrack$1 & SegmentAccessMethods & VideoDynamicRangeMethods & TrackMetadataOverrideMethods;
|
|
572
|
-
type InputAudioTrack = InputAudioTrack$1 & SegmentAccessMethods & TrackMetadataOverrideMethods;
|
|
573
|
-
type InputSubtitleTrack = MediabunnySubtitleTrackLike & SegmentAccessMethods & TrackMetadataOverrideMethods;
|
|
573
|
+
type InputTrack$1 = InputTrack$2 & SegmentAccessMethods & TrackMetadataOverrideMethods & TrackSourceMethods;
|
|
574
|
+
type InputVideoTrack = InputVideoTrack$1 & SegmentAccessMethods & VideoDynamicRangeMethods & TrackMetadataOverrideMethods & TrackSourceMethods;
|
|
575
|
+
type InputAudioTrack = InputAudioTrack$1 & SegmentAccessMethods & TrackMetadataOverrideMethods & TrackSourceMethods;
|
|
576
|
+
type InputSubtitleTrack = MediabunnySubtitleTrackLike & SegmentAccessMethods & TrackMetadataOverrideMethods & TrackSourceMethods;
|
|
574
577
|
type InputSubtitleSource = PathedSource | SourceRef<PathedSource>;
|
|
575
578
|
type InputSubtitleTrackMetadata = {
|
|
576
579
|
codec?: SubtitleCodec | null;
|
|
@@ -607,6 +610,7 @@ type SegmentableBacking = {
|
|
|
607
610
|
getDecoderConfig?(): Promise<VideoDecoderConfig | AudioDecoderConfig | null>;
|
|
608
611
|
getMetadataCodecParameterString?(): string | null | Promise<string | null>;
|
|
609
612
|
getSegmentedInput?(): HlsSegmentedInput | DashSegmentedInput;
|
|
613
|
+
getSource?(): Source;
|
|
610
614
|
};
|
|
611
615
|
type NativeTrackBacking = SegmentableBacking;
|
|
612
616
|
type TrackBacking = NativeTrackBacking | SegmentableBacking;
|
|
@@ -632,6 +636,7 @@ declare class ImportedAudioTrackBacking {
|
|
|
632
636
|
isRelativeToUnixEpoch(): boolean | Promise<boolean>;
|
|
633
637
|
getDisposition(): {};
|
|
634
638
|
getPairingMask(): bigint;
|
|
639
|
+
getSource(): Source;
|
|
635
640
|
getBitrate(): number | Promise<number | null> | null;
|
|
636
641
|
getAverageBitrate(): number | Promise<number | null> | null;
|
|
637
642
|
getDurationFromMetadata(options: unknown): Promise<number | null>;
|
package/dist/index.mjs
CHANGED
|
@@ -1419,11 +1419,13 @@ var ImportedAudioTrackBacking = class {
|
|
|
1419
1419
|
#backing;
|
|
1420
1420
|
#id;
|
|
1421
1421
|
#number;
|
|
1422
|
+
#source;
|
|
1422
1423
|
#wholeResourceSegmentedInput;
|
|
1423
1424
|
constructor(params) {
|
|
1424
1425
|
this.#backing = params.backing;
|
|
1425
1426
|
this.#id = params.id;
|
|
1426
1427
|
this.#number = params.number;
|
|
1428
|
+
this.#source = params.source;
|
|
1427
1429
|
this.#wholeResourceSegmentedInput = new WholeResourceAudioSegmentedInput(params.source);
|
|
1428
1430
|
}
|
|
1429
1431
|
getType() {
|
|
@@ -1459,6 +1461,9 @@ var ImportedAudioTrackBacking = class {
|
|
|
1459
1461
|
getPairingMask() {
|
|
1460
1462
|
return 0n;
|
|
1461
1463
|
}
|
|
1464
|
+
getSource() {
|
|
1465
|
+
return this.#source;
|
|
1466
|
+
}
|
|
1462
1467
|
getBitrate() {
|
|
1463
1468
|
return this.#backing.getBitrate?.() ?? null;
|
|
1464
1469
|
}
|
|
@@ -1540,6 +1545,9 @@ const getSegmentedInputForTrack = (track) => {
|
|
|
1540
1545
|
return internalTrack.demuxer.getSegmentedInputForPath(internalTrack.fullPath);
|
|
1541
1546
|
};
|
|
1542
1547
|
const getTrackBacking = (track) => track._backing;
|
|
1548
|
+
const getTrackSource = (track) => {
|
|
1549
|
+
return getTrackBacking(track).getSource?.() ?? track.input.source;
|
|
1550
|
+
};
|
|
1543
1551
|
const getTrackMetadataOverrides = (backing) => backing[TRACK_METADATA_OVERRIDES] ??= {};
|
|
1544
1552
|
const ensureLanguageCodeOverridePatch = (backing) => {
|
|
1545
1553
|
const patchedBacking = backing;
|
|
@@ -1552,6 +1560,7 @@ const setTrackLanguageCode = (track, value) => {
|
|
|
1552
1560
|
getTrackMetadataOverrides(ensureLanguageCodeOverridePatch(getTrackBacking(track))).languageCode = value;
|
|
1553
1561
|
};
|
|
1554
1562
|
const addSegmentAccess = (track) => new Proxy(track, { get(target, prop) {
|
|
1563
|
+
if (prop === "source") return getTrackSource(target);
|
|
1555
1564
|
if (prop === "getDynamicRange" && target instanceof InputVideoTrack) return () => getDynamicRangeForTrack(target);
|
|
1556
1565
|
if (prop === "setLanguageCode") return (value) => setTrackLanguageCode(target, value);
|
|
1557
1566
|
if (prop === "getSegmentedInput") return () => getSegmentedInputForTrack(target);
|