Skip to content

Function: parseByteRangeString() ​

ts
function parseByteRangeString(byteRangeString): ByteRangeObject | undefined;

Defined in: utils/byteRange.ts:26

Alpha

Parses a byteRange string in either HLS format (length@offset) or DASH format (start-end) and converts it to an object with start and end properties.

Parameters ​

byteRangeString ​

string | undefined

String in format length@offset or start-end

Returns ​

ByteRangeObject | undefined

Object with start and end properties, or undefined if input is invalid

Example ​

ts
parseByteRangeString("1234@0")    // { start: 0, end: 1233 }
parseByteRangeString("0-1233")    // { start: 0, end: 1233 }

A Streaming Video Technology Alliance project.