dasha 4.3.0 → 4.3.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 +3 -3
- package/dist/index.mjs +11 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -396,6 +396,7 @@ declare abstract class DashTrackBackingBase {
|
|
|
396
396
|
getNextKeyPacket(packet: EncodedPacket, options: PacketRetrievalOptions): Promise<EncodedPacket | null>;
|
|
397
397
|
getSegmentedInput(): DashSegmentedInput;
|
|
398
398
|
getSegments(): Promise<DashSegment[]>;
|
|
399
|
+
refreshSegments(): Promise<DashSegment[]>;
|
|
399
400
|
}
|
|
400
401
|
declare class DashInputVideoTrackBacking extends DashTrackBackingBase {
|
|
401
402
|
internalTrack: InternalVideoTrack;
|
|
@@ -557,6 +558,7 @@ declare module 'mediabunny' {
|
|
|
557
558
|
type SegmentAccessMethods = {
|
|
558
559
|
getSegmentedInput(): HlsSegmentedInput | DashSegmentedInput;
|
|
559
560
|
getSegments(): Promise<(HlsSegment | DashSegment)[]>;
|
|
561
|
+
refreshSegments(): Promise<(HlsSegment | DashSegment)[]>;
|
|
560
562
|
};
|
|
561
563
|
type TrackMetadataOverrideMethods = {
|
|
562
564
|
setLanguageCode(value: string): void;
|
|
@@ -629,8 +631,6 @@ declare class Input<S extends Source = Source> extends SegmentedMediabunnyInput<
|
|
|
629
631
|
constructor(options: DashaInputOptions<S>);
|
|
630
632
|
}
|
|
631
633
|
declare const isInput: (value: unknown) => value is Input;
|
|
632
|
-
declare const getSegmentedInput: (track: InputTrack$1) => InputSegmentedInput;
|
|
633
|
-
declare const getSegments: (track: InputTrack$1) => Promise<InputSegment[]>;
|
|
634
634
|
declare const ALL_FORMATS: InputFormat[];
|
|
635
635
|
//#endregion
|
|
636
|
-
export { ALL_FORMATS, type AudioCodec, DASH, DASH_FORMATS, type DashSegment, type DashSegmentedInput, FilePathSource, HLS, HLS_FORMATS, type HlsSegment, type HlsSegmentedInput, Input, type InputAudioTrack, InputSegment, InputSegmentedInput, 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,
|
|
636
|
+
export { ALL_FORMATS, type AudioCodec, DASH, DASH_FORMATS, type DashSegment, type DashSegmentedInput, FilePathSource, HLS, HLS_FORMATS, type HlsSegment, type HlsSegmentedInput, Input, type InputAudioTrack, InputSegment, InputSegmentedInput, 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, isInput, prefer, preserveSubtitleBackingsOnInput };
|
package/dist/index.mjs
CHANGED
|
@@ -1430,6 +1430,11 @@ const addSegmentAccess = (track) => new Proxy(track, { get(target, prop) {
|
|
|
1430
1430
|
if (prop === "setLanguageCode") return (value) => setTrackLanguageCode(target, value);
|
|
1431
1431
|
if (prop === "getSegmentedInput") return () => getSegmentedInputForTrack(target);
|
|
1432
1432
|
if (prop === "getSegments") return async () => {
|
|
1433
|
+
const segmentedInput = getSegmentedInputForTrack(target);
|
|
1434
|
+
if (segmentedInput.segments.length === 0) await segmentedInput.runUpdateSegments();
|
|
1435
|
+
return segmentedInput.segments;
|
|
1436
|
+
};
|
|
1437
|
+
if (prop === "refreshSegments") return async () => {
|
|
1433
1438
|
const segmentedInput = getSegmentedInputForTrack(target);
|
|
1434
1439
|
await segmentedInput.runUpdateSegments();
|
|
1435
1440
|
return segmentedInput.segments;
|
|
@@ -2670,6 +2675,11 @@ var DashTrackBackingBase = class {
|
|
|
2670
2675
|
return this.internalTrack.demuxer.getSegmentedInputForTrack(this.internalTrack);
|
|
2671
2676
|
}
|
|
2672
2677
|
async getSegments() {
|
|
2678
|
+
const segmentedInput = this.getSegmentedInput();
|
|
2679
|
+
if (segmentedInput.segments.length === 0) await segmentedInput.runUpdateSegments();
|
|
2680
|
+
return segmentedInput.segments;
|
|
2681
|
+
}
|
|
2682
|
+
async refreshSegments() {
|
|
2673
2683
|
const segmentedInput = this.getSegmentedInput();
|
|
2674
2684
|
await segmentedInput.runUpdateSegments();
|
|
2675
2685
|
return segmentedInput.segments;
|
|
@@ -2787,8 +2797,6 @@ var Input = class extends SegmentedMediabunnyInput {
|
|
|
2787
2797
|
}
|
|
2788
2798
|
};
|
|
2789
2799
|
const isInput = (value) => value instanceof Input;
|
|
2790
|
-
const getSegmentedInput = (track) => track.getSegmentedInput();
|
|
2791
|
-
const getSegments = async (track) => track.getSegments();
|
|
2792
2800
|
const ALL_FORMATS = [...ALL_FORMATS$1, DASH];
|
|
2793
2801
|
//#endregion
|
|
2794
|
-
export { ALL_FORMATS, DASH, DASH_FORMATS, FilePathSource, HLS, HLS_FORMATS, Input, MP3, MP4, UrlSource, asc, desc,
|
|
2802
|
+
export { ALL_FORMATS, DASH, DASH_FORMATS, FilePathSource, HLS, HLS_FORMATS, Input, MP3, MP4, UrlSource, asc, desc, isInput, prefer, preserveSubtitleBackingsOnInput };
|