Function: processUriTemplate()
ts
function processUriTemplate(
uriTemplate,
representationId,
number,
subNumber,
bandwidth,
time
): string;Defined in: processUriTemplate.ts:20
Process a URI template used in SegmentTemplate nodes.
Parameters
uriTemplate
string
URI template to process.
representationId
string | null | undefined
Representation ID.
number
number | null | undefined
Number.
subNumber
number | null | undefined
Sub-number.
bandwidth
number | null | undefined
Bandwidth.
time
string | number | null | undefined
Time. Should be passed as a number unless the value is larger than MAX_SAFE_INTEGER, then it should be provided as a string. If the value is a string all format tags will be ignored.
Returns
string
Processed URI template.
Example
ts
const result = processUriTemplate(
'http://example.com/$RepresentationID$/$Number$/$SubNumber$/$Bandwidth$/$Time%02d$/$$',
'rep1', // RepresentationID
1, // Number
2, // SubNumber
3, // Bandwidth
4, // Time
)
assert(result === 'http://example.com/rep1/1/2/3/04/$')