m3u8parse
Version:
Structural parsing of Apple HTTP Live Streaming .m3u8 format
37 lines (36 loc) • 1.53 kB
TypeScript
import type * as AttrT from './attr-types.ts';
import { AttrList, Byterange } from './attrlist.ts';
import { IRewritableUris, UriMapFunction } from './playlist-base.ts';
import type { Proto } from './types.ts';
export declare class MediaSegment implements IRewritableUris {
uri?: string | undefined;
duration?: number | undefined;
title?: string | undefined;
discontinuity: boolean;
program_time?: Date | null | undefined;
keys?: AttrList<AttrT.Key>[] | undefined;
byterange?: Byterange | undefined;
map?: AttrList<AttrT.Map> | undefined;
gap?: boolean | undefined;
bitrate?: number | undefined;
parts?: AttrList<AttrT.Part>[] | undefined;
vendor?: Iterable<[string, string | null]> | undefined;
constructor(obj?: Proto<MediaSegment>);
constructor(uri: string | typeof URL | undefined, meta: Readonly<MediaSegment>, version?: number);
constructor(uri: string | typeof URL | undefined, meta: Proto<MediaSegment>, version?: number);
isPartial(): this is PartialSegment;
rewriteUris(mapFn: UriMapFunction<'segment' | 'segment-key' | 'segment-map' | 'segment-part'>): this;
}
interface FullSegment extends Readonly<MediaSegment> {
duration: number;
title: string;
uri: string;
}
interface PartialSegment extends Readonly<MediaSegment> {
readonly __isPartial__: undefined;
}
export type ImmutableMediaSegment = PartialSegment | FullSegment;
export type IndependentSegment = ImmutableMediaSegment & {
byterange?: Required<Byterange>;
};
export {};