Skip to content

Function: iso8601DurationToNumber() ​

ts
function iso8601DurationToNumber(isoDuration): number;

Defined in: utils/dash/iso8601DurationToNumber.ts:15

Internal

Converts the ISO 8601 duration of an MPD attribute to seconds.

The function trims the whitespace that the XML scanner keeps around an attribute value, and decodes the rest with decodeIso8601Duration. A value that is not an ISO 8601 duration gives 0.

Parameters ​

isoDuration ​

string

The ISO 8601 duration, such as PT1H2M3S or P1DT2H.

Returns ​

number

The duration in seconds.

A Streaming Video Technology Alliance project.