UNPKG

npaw-plugin-nwf

Version:
28 lines (27 loc) 1.14 kB
/** * Minimal DASH SegmentBase SIDX parser. Given the raw bytes of an MP4 fragment * that contains a `sidx` box and the absolute byte offset at which those bytes * start in the remote resource, emits the list of sub-segments (byte ranges * and presentation times). * * Wire-compatible with iOS `DashSidxParser.swift` and Android `DashSidxParser.kt` * — the same input produces the same `DashSidxIndex` on all three platforms, * so segment IDs derived from these ranges match across the swarm. */ export type DashSidxSegment = { /** Absolute byte offset of the first byte of this sub-segment in the resource. */ start: number; /** Absolute byte offset of the last byte, inclusive. */ endInclusive: number; /** Presentation time of the first frame, in `timescale` units. */ presentationTimeUnits: number; /** Duration of the sub-segment, in `timescale` units. */ durationUnits: number; }; export type DashSidxIndex = { timescale: number; segments: DashSidxSegment[]; }; export declare const DashSidxParser: { parse(bytes: Uint8Array, absoluteOffset: number): DashSidxIndex | undefined; };