Skip to content

Commit

Permalink
Some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
younesaassila committed Dec 24, 2023
1 parent feea9c7 commit adfcc3d
Show file tree
Hide file tree
Showing 4 changed files with 252 additions and 134 deletions.
98 changes: 65 additions & 33 deletions src/m3u8-parser.d.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,73 @@
declare module "m3u8-parser" {
// https://github.com/videojs/m3u8-parser#parsed-output
interface Manifest {
allowCache: boolean;
endList?: boolean;
mediaSequence?: number;
dateRanges: [];
discontinuitySequence?: number;
playlistType?: string;
custom?: {};
playlists?: {
attributes: {
"FRAME-RATE": number;
VIDEO: string;
CODECS: string;
RESOLUTION: {
width: number;
height: number;
};
BANDWIDTH: number;
};
uri: string;
timeline: number;
}[];
mediaGroups?: {
AUDIO: {};
VIDEO: {};
"CLOSED-CAPTIONS": {};
SUBTITLES: {};
};
dateTimeString?: string;
dateTimeObject?: Date;
targetDuration?: number;
totalDuration?: number;
discontinuityStarts: number[];
segments: {
title: string;
byterange: {
length: number;
offset: number;
};
duration: number;
programDateTime: number;
attributes: {};
discontinuity: number;
uri: string;
timeline: number;
key: {
method: string;
uri: string;
iv: string;
};
map: {
uri: string;
byterange: {
length: number;
offset: number;
};
};
"cue-out": string;
"cue-out-cont": string;
"cue-in": string;
custom: {};
}[];
}

export class Parser {
constructor();
push(chunk: string): void;
end(): void;
manifest: Manifest;
}
}

interface Manifest {
allowCache: boolean;
discontinuityStarts: any[];
dateRanges: any[];
segments: any[];
mediaGroups?: {
AUDIO: {};
VIDEO: {};
"CLOSED-CAPTIONS": {};
SUBTITLES: {};
};
playlists?: Playlist[];
}

interface Playlist {
attributes: Attributes;
uri: string;
timeline: number;
}

interface Attributes {
"FRAME-RATE": number;
VIDEO: string;
CODECS: string;
RESOLUTION: Resolution;
BANDWIDTH: number;
}

interface Resolution {
width: number;
height: number;
}
Loading

0 comments on commit adfcc3d

Please # to comment.