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

## Class SsManifest.StreamElement

- java.lang.Object
- - com.google.android.exoplayer2.source.smoothstreaming.manifest.SsManifest.StreamElement

- Enclosing class:
    SsManifest

      public static class SsManifest.StreamElement
      extends Object

  Represents a StreamIndex element.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `int` | `chunkCount` |
    `int` | `displayHeight` |
    `int` | `displayWidth` |
    `Format[]` | `formats` |
    `String` | `language` |
    `int` | `maxHeight` |
    `int` | `maxWidth` |
    `String` | `name` |
    `String` | `subType` |
    `long` | `timescale` |
    `int` | `type` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StreamElement​(String baseUri, String chunkTemplate, int type, String subType, long timescale, String name, int maxWidth, int maxHeight, int displayWidth, int displayHeight, String language, Format[] formats, List<Long> chunkStartTimes, long lastChunkDuration)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Uri` | `buildRequestUri​(int track, int chunkIndex)` | Builds a uri for requesting the specified chunk of the specified track.
    `SsManifest.StreamElement` | `copy​(Format[] formats)` | Creates a copy of this stream element with the formats replaced with those specified.
    `long` | `getChunkDurationUs​(int chunkIndex)` | Returns the duration of the specified chunk.
    `int` | `getChunkIndex​(long timeUs)` | Returns the index of the chunk that contains the specified time.
    `long` | `getStartTimeUs​(int chunkIndex)` | Returns the start time of the specified chunk.

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

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

- - ### Field Detail

    - #### type

          public final int type

    - #### subType

          public final String subType

    - #### timescale

          public final long timescale

    - #### name

          public final String name

    - #### maxWidth

          public final int maxWidth

    - #### maxHeight

          public final int maxHeight

    - #### displayWidth

          public final int displayWidth

    - #### displayHeight

          public final int displayHeight

    - #### language

          @Nullable
          public final String language

    - #### formats

          public final Format[] formats

    - #### chunkCount

          public final int chunkCount

  - ### Constructor Detail

    - #### StreamElement

          public StreamElement​(String baseUri,
                               String chunkTemplate,
                               int type,
                               String subType,
                               long timescale,
                               String name,
                               int maxWidth,
                               int maxHeight,
                               int displayWidth,
                               int displayHeight,
                               @Nullable
                               String language,
                               Format[] formats,
                               List<Long> chunkStartTimes,
                               long lastChunkDuration)

  - ### Method Detail

    - #### copy

          public SsManifest.StreamElement copy​(Format[] formats)

      Creates a copy of this stream element with the formats replaced with those specified.
      Parameters:
        `formats` - The formats to be included in the copy.
      Returns:
        A copy of this stream element with the formats replaced.
      Throws:
        `IndexOutOfBoundsException` - If a key has an invalid index.

    - #### getChunkIndex

          public int getChunkIndex​(long timeUs)

      Returns the index of the chunk that contains the specified time.
      Parameters:
        `timeUs` - The time in microseconds.
      Returns:
        The index of the corresponding chunk.

    - #### getStartTimeUs

          public long getStartTimeUs​(int chunkIndex)

      Returns the start time of the specified chunk.
      Parameters:
        `chunkIndex` - The index of the chunk.
      Returns:
        The start time of the chunk, in microseconds.

    - #### getChunkDurationUs

          public long getChunkDurationUs​(int chunkIndex)

      Returns the duration of the specified chunk.
      Parameters:
        `chunkIndex` - The index of the chunk.
      Returns:
        The duration of the chunk, in microseconds.

    - #### buildRequestUri

          public Uri buildRequestUri​(int track,
                                     int chunkIndex)

      Builds a uri for requesting the specified chunk of the specified track.
      Parameters:
        `track` - The index of the track for which to build the URL.
        `chunkIndex` - The index of the chunk for which to build the URL.
      Returns:
        The request uri.