@svta/common-media-library
    Preparing search index...

    Function processUriTemplate

    • Beta

      Process a URI template used in SegmentTemplate nodes.

      Parameters

      • uriTemplate: string

        URI template to process.

      • representationId: undefined | null | string

        Representation ID.

      • number: undefined | null | number

        Number.

      • subNumber: undefined | null | number

        Sub-number.

      • bandwidth: undefined | null | number

        Bandwidth.

      • time: undefined | null | string | number

        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.

      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/$');