Package com.google.android.exoplayer2.source.dash.manifest

## Class Representation

- java.lang.Object
- - com.google.android.exoplayer2.source.dash.manifest.Representation

- Direct Known Subclasses:
    `Representation.MultiSegmentRepresentation`, `Representation.SingleSegmentRepresentation`

      public abstract class Representation
      extends Object

  A DASH representation.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `Representation.MultiSegmentRepresentation` | A DASH representation consisting of multiple segments.
    `static class` | `Representation.SingleSegmentRepresentation` | A DASH representation consisting of a single segment.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `String` | `baseUrl` | The base URL of the representation.
    `Format` | `format` | The format of the representation.
    `List<Descriptor>` | `inbandEventStreams` | The in-band event streams in the representation.
    `long` | `presentationTimeOffsetUs` | The offset of the presentation timestamps in the media stream relative to media time.
    `static long` | `REVISION_ID_DEFAULT` | A default value for `revisionId`.
    `long` | `revisionId` | Identifies the revision of the media contained within the representation.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `abstract String` | `getCacheKey()` | Returns a cache key for the representation if set, or null.
    `abstract DashSegmentIndex` | `getIndex()` | Returns an index if the representation provides one directly, or null otherwise.
    `abstract RangedUri` | `getIndexUri()` | Returns a `RangedUri` defining the location of the representation's segment index, or null if the representation provides an index directly.
    `RangedUri` | `getInitializationUri()` | Returns a `RangedUri` defining the location of the representation's initialization data, or null if no initialization data exists.
    `static Representation` | `newInstance​(long revisionId, Format format, String baseUrl, SegmentBase segmentBase)` | Constructs a new instance.
    `static Representation` | `newInstance​(long revisionId, Format format, String baseUrl, SegmentBase segmentBase, List<Descriptor> inbandEventStreams)` | Constructs a new instance.
    `static Representation` | `newInstance​(long revisionId, Format format, String baseUrl, SegmentBase segmentBase, List<Descriptor> inbandEventStreams, String cacheKey)` | Constructs a new instance.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### REVISION_ID_DEFAULT

          public static final long REVISION_ID_DEFAULT

      A default value for `revisionId`.
      See Also:
        Constant Field Values

    - #### revisionId

          public final long revisionId

      Identifies the revision of the media contained within the representation. If the media can change over time (e.g. as a result of it being re-encoded), then this identifier can be set to uniquely identify the revision of the media. The timestamp at which the media was encoded is often a suitable.

    - #### format

          public final Format format

      The format of the representation.

    - #### baseUrl

          public final String baseUrl

      The base URL of the representation.

    - #### presentationTimeOffsetUs

          public final long presentationTimeOffsetUs

      The offset of the presentation timestamps in the media stream relative to media time.

    - #### inbandEventStreams

          public final List<Descriptor> inbandEventStreams

      The in-band event streams in the representation. May be empty.

  - ### Method Detail

    - #### newInstance

          public static Representation newInstance​(long revisionId,
                                                   Format format,
                                                   String baseUrl,
                                                   SegmentBase segmentBase)

      Constructs a new instance.
      Parameters:
        `revisionId` - Identifies the revision of the content.
        `format` - The format of the representation.
        `baseUrl` - The base URL.
        `segmentBase` - A segment base element for the representation.
      Returns:
        The constructed instance.

    - #### newInstance

          public static Representation newInstance​(long revisionId,
                                                   Format format,
                                                   String baseUrl,
                                                   SegmentBase segmentBase,
                                                   @Nullable
                                                   List<Descriptor> inbandEventStreams)

      Constructs a new instance.
      Parameters:
        `revisionId` - Identifies the revision of the content.
        `format` - The format of the representation.
        `baseUrl` - The base URL.
        `segmentBase` - A segment base element for the representation.
        `inbandEventStreams` - The in-band event streams in the representation. May be null.
      Returns:
        The constructed instance.

    - #### newInstance

          public static Representation newInstance​(long revisionId,
                                                   Format format,
                                                   String baseUrl,
                                                   SegmentBase segmentBase,
                                                   @Nullable
                                                   List<Descriptor> inbandEventStreams,
                                                   @Nullable
                                                   String cacheKey)

      Constructs a new instance.
      Parameters:
        `revisionId` - Identifies the revision of the content.
        `format` - The format of the representation.
        `baseUrl` - The base URL of the representation.
        `segmentBase` - A segment base element for the representation.
        `inbandEventStreams` - The in-band event streams in the representation. May be null.
        `cacheKey` - An optional key to be returned from `getCacheKey()`, or null. This parameter is ignored if `segmentBase` consists of multiple segments.
      Returns:
        The constructed instance.

    - #### getInitializationUri

          @Nullable
          public RangedUri getInitializationUri()

      Returns a `RangedUri` defining the location of the representation's initialization data, or null if no initialization data exists.

    - #### getIndexUri

          @Nullable
          public abstract RangedUri getIndexUri()

      Returns a `RangedUri` defining the location of the representation's segment index, or null if the representation provides an index directly.

    - #### getIndex

          @Nullable
          public abstract DashSegmentIndex getIndex()

      Returns an index if the representation provides one directly, or null otherwise.

    - #### getCacheKey

          @Nullable
          public abstract String getCacheKey()

      Returns a cache key for the representation if set, or null.