> Documentation index: https://developer.android.com/reference/llms.txt

# SsManifest.StreamElement

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

*** ** * ** ***


```
public class SsManifest.StreamElement
```

<br />

*** ** * ** ***

Represents a StreamIndex element.

## Summary

| ### Public fields |
|---|---|
| `final int` | `chunkCount` |
| `final int` | `displayHeight` |
| `final int` | `displayWidth` |
| `final Format[]` | `formats` |
| `final @Nullable String` | `language` |
| `final int` | `maxHeight` |
| `final int` | `maxWidth` |
| `final String` | `name` |
| `final String` | `subType` |
| `final long` | `timescale` |
| `final int` | `@C.TrackType type` |

| ### Public constructors |
|---|
| `StreamElement( String baseUri, String chunkTemplate, @C.TrackType 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 )` |

| ### Public methods |
|---|---|
| `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. |

## Public fields

### chunkCount

```
public final int chunkCount
```

### displayHeight

```
public final int displayHeight
```

### displayWidth

```
public final int displayWidth
```

### formats

```
public final Format[] formats
```

### language

```
public final @Nullable String language
```

### maxHeight

```
public final int maxHeight
```

### maxWidth

```
public final int maxWidth
```

### name

```
public final String name
```

### subType

```
public final String subType
```

### timescale

```
public final long timescale
```

### type

```
@C.TrackType
public final int type
```

## Public constructors

### StreamElement

```
public StreamElement(
    String baseUri,
    String chunkTemplate,
    @C.TrackType 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
)
```

## Public methods

### buildRequestUri

```
public Uri buildRequestUri(int track, int chunkIndex)
```

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

| Parameters |
|---|---|
| `int track` | The index of the track for which to build the URL. |
| `int chunkIndex` | The index of the chunk for which to build the URL. |

| Returns |
|---|---|
| `Uri` | The request uri. |

### copy

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

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

| Parameters |
|---|---|
| `Format[] formats` | The formats to be included in the copy. |

| Returns |
|---|---|
| `SsManifest.StreamElement` | A copy of this stream element with the formats replaced. |

| Throws |
|---|---|
| `java.lang.IndexOutOfBoundsException` | If a key has an invalid index. |

### getChunkDurationUs

```
public long getChunkDurationUs(int chunkIndex)
```

Returns the duration of the specified chunk.

| Parameters |
|---|---|
| `int chunkIndex` | The index of the chunk. |

| Returns |
|---|---|
| `long` | The duration of the chunk, in microseconds. |

### getChunkIndex

```
public int getChunkIndex(long timeUs)
```

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

| Parameters |
|---|---|
| `long timeUs` | The time in microseconds. |

| Returns |
|---|---|
| `int` | The index of the corresponding chunk. |

### getStartTimeUs

```
public long getStartTimeUs(int chunkIndex)
```

Returns the start time of the specified chunk.

| Parameters |
|---|---|
| `int chunkIndex` | The index of the chunk. |

| Returns |
|---|---|
| `long` | The start time of the chunk, in microseconds. |