# SsManifest.StreamElement

# SsManifest.StreamElement

Artifact:[androidx.media3:media3-exoplayer-smoothstreaming](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.java+class:androidx.media3.exoplayer.smoothstreaming.manifest.SsManifest.StreamElement)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement "View this page in Java")

<br />

```
class SsManifest.StreamElement
```

<br />

*** ** * ** ***

Represents a StreamIndex element.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [StreamElement](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#StreamElement(java.lang.String,java.lang.String,int,java.lang.String,long,java.lang.String,int,int,int,int,java.lang.String,androidx.media3.common.Format[],java.util.List<java.lang.Long>,long))`(` ` baseUri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` chunkTemplate: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` @`[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)` type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` subType: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` timescale: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` name: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` maxWidth: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` maxHeight: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` displayWidth: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` displayHeight: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` language: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?,` ` formats: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!>!,` ` chunkStartTimes: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`!>!,` ` lastChunkDuration: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)` |

|                                                                   ### Public functions                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html)`!`                                                                                    | [buildRequestUri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#buildRequestUri(int,int))`(track: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, chunkIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Builds a uri for requesting the specified chunk of the specified track.                        |
| [SsManifest.StreamElement](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement)`!` | [copy](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#copy(androidx.media3.common.Format[]))`(formats: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!>!)` Creates a copy of this stream element with the formats replaced with those specified. |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                             | [getChunkDurationUs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#getChunkDurationUs(int))`(chunkIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the duration of the specified chunk.                                                                                                                                       |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                               | [getChunkIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#getChunkIndex(long))`(timeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Returns the index of the chunk that contains the specified time.                                                                                                                              |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                             | [getStartTimeUs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#getStartTimeUs(int))`(chunkIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the start time of the specified chunk.                                                                                                                                             |

|                                                                             ### Public properties                                                                             |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | [chunkCount](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#chunkCount())                                                                                         |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | [displayHeight](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#displayHeight())                                                                                   |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | [displayWidth](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#displayWidth())                                                                                     |
| [Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!>!` | [formats](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#formats())                                                                                               |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?`                                                                                          | [language](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#language())                                                                                             |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | [maxHeight](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#maxHeight())                                                                                           |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | [maxWidth](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#maxWidth())                                                                                             |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                          | [name](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#name())                                                                                                     |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                          | [subType](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#subType())                                                                                               |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                 | [timescale](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#timescale())                                                                                           |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | `@`[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType) [type](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement#type()) |

## Public constructors

### StreamElement

```
StreamElement(
    baseUri: String!,
    chunkTemplate: String!,
    @C.TrackType type: Int,
    subType: String!,
    timescale: Long,
    name: String!,
    maxWidth: Int,
    maxHeight: Int,
    displayWidth: Int,
    displayHeight: Int,
    language: String?,
    formats: Array<Format!>!,
    chunkStartTimes: (Mutable)List<Long!>!,
    lastChunkDuration: Long
)
```  

## Public functions

### buildRequestUri

```
fun buildRequestUri(track: Int, chunkIndex: Int): Uri!
```

Builds a uri for requesting the specified chunk of the specified track.  

|                                        Parameters                                         |
|-------------------------------------------------------------------------------------------|----------------------------------------------------|
| `track: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)      | The index of the track for which to build the URL. |
| `chunkIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The index of the chunk for which to build the URL. |

|                                Returns                                 |
|------------------------------------------------------------------------|------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri.html)`!` | The request uri. |

### copy

```
fun copy(formats: Array<Format!>!): SsManifest.StreamElement!
```

Creates a copy of this stream element with the formats replaced with those specified.  

|                                                                                        Parameters                                                                                        |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| `formats: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!>!` | The formats to be included in the copy. |

|                                                                          Returns                                                                          |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| [SsManifest.StreamElement](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest.StreamElement)`!` | A copy of this stream element with the formats replaced. |

|                                                         Throws                                                          |
|-------------------------------------------------------------------------------------------------------------------------|--------------------------------|
| [java.lang.IndexOutOfBoundsException](https://developer.android.com/reference/java/lang/IndexOutOfBoundsException.html) | If a key has an invalid index. |

### getChunkDurationUs

```
fun getChunkDurationUs(chunkIndex: Int): Long
```

Returns the duration of the specified chunk.  

|                                        Parameters                                         |
|-------------------------------------------------------------------------------------------|-------------------------|
| `chunkIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The index of the chunk. |

|                                    Returns                                    |
|-------------------------------------------------------------------------------|---------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The duration of the chunk, in microseconds. |

### getChunkIndex

```
fun getChunkIndex(timeUs: Long): Int
```

Returns the index of the chunk that contains the specified time.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|---------------------------|
| `timeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The time in microseconds. |

|                                   Returns                                   |
|-----------------------------------------------------------------------------|---------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The index of the corresponding chunk. |

### getStartTimeUs

```
fun getStartTimeUs(chunkIndex: Int): Long
```

Returns the start time of the specified chunk.  

|                                        Parameters                                         |
|-------------------------------------------------------------------------------------------|-------------------------|
| `chunkIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The index of the chunk. |

|                                    Returns                                    |
|-------------------------------------------------------------------------------|-----------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The start time of the chunk, in microseconds. |

## Public properties

### chunkCount

```
val chunkCount: Int
```  

### displayHeight

```
val displayHeight: Int
```  

### displayWidth

```
val displayWidth: Int
```  

### formats

```
val formats: Array<Format!>!
```  

### language

```
val language: String?
```  

### maxHeight

```
val maxHeight: Int
```  

### maxWidth

```
val maxWidth: Int
```  

### name

```
val name: String!
```  

### subType

```
val subType: String!
```  

### timescale

```
val timescale: Long
```  

### type

```
@C.TrackType
val type: Int
```