Class UrlTemplate

  • @Deprecated
    public final class UrlTemplate
    extends Object
    Deprecated. is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    A template from which URLs can be built.

    URLs are built according to the substitution rules defined in ISO/IEC 23009-1:2014

    • Method Detail

      • compile

        public static UrlTemplate compile​(String template)
        Compile an instance from the provided template string.
        template - The template.
        The compiled instance.
        IllegalArgumentException - If the template string is malformed.
      • buildUri

        public String buildUri​(String representationId,
                               long segmentNumber,
                               int bandwidth,
                               long time)
        Constructs a Uri from the template, substituting in the provided arguments.

        Arguments whose corresponding identifiers are not present in the template will be ignored.

        representationId - The representation identifier.
        segmentNumber - The segment number.
        bandwidth - The bandwidth.
        time - The time as specified by the segment timeline.
        The built Uri.