# HlsMultivariantPlaylist.Variant

Artifact: [androidx.media3:media3-exoplayer-hls](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.java+class:androidx.media3.exoplayer.hls.playlist.HlsMultivariantPlaylist.Variant)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant "View this page in Java")


```
class HlsMultivariantPlaylist.Variant
```

<br />

*** ** * ** ***

A variant (i.e. an #EXT-X-STREAM-INF tag) in a multivariant playlist.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#Variant(android.net.Uri,androidx.media3.common.Format,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)( url: https://developer.android.com/reference/android/net/Uri.html!, format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, videoGroupId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, audioGroupId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, subtitleGroupId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, captionGroupId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, pathwayId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?, stableVariantId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#copyWithFormat(androidx.media3.common.Format)(format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!)` Returns a copy of this instance with the given `https://developer.android.com/reference/kotlin/androidx/media3/common/Format`. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#createMediaPlaylistVariantUrl(android.net.Uri)(url: https://developer.android.com/reference/android/net/Uri.html!)` Creates a variant for a given media playlist url. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#audioGroupId()` The audio rendition group referenced by this variant, or `null`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#captionGroupId()` The caption rendition group referenced by this variant, or `null`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#format()` Format information associated with this variant. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#pathwayId()` The identifier of the pathway that this variant belongs, or `null`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#stableVariantId()` The stable identifier for this variant, or `null`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#subtitleGroupId()` The subtitle rendition group referenced by this variant, or `null`. |
| `https://developer.android.com/reference/android/net/Uri.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#url()` The variant's url. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#videoGroupId()` The video rendition group referenced by this variant, or `null`. |

## Public constructors

### Variant

```
Variant(
    url: Uri!,
    format: Format!,
    videoGroupId: String?,
    audioGroupId: String?,
    subtitleGroupId: String?,
    captionGroupId: String?,
    pathwayId: String?,
    stableVariantId: String?
)
```

| Parameters |
|---|---|
| `url: https://developer.android.com/reference/android/net/Uri.html!` | See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#url()`. |
| `format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#format()`. |
| `videoGroupId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#videoGroupId()`. |
| `audioGroupId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#audioGroupId()`. |
| `subtitleGroupId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#subtitleGroupId()`. |
| `captionGroupId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#captionGroupId()`. |
| `pathwayId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#pathwayId()`. |
| `stableVariantId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | See `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant#stableVariantId()`. |

## Public functions

### copyWithFormat

```
fun copyWithFormat(format: Format!): HlsMultivariantPlaylist.Variant!
```

Returns a copy of this instance with the given `https://developer.android.com/reference/kotlin/androidx/media3/common/Format`.

### createMediaPlaylistVariantUrl

```
java-static fun createMediaPlaylistVariantUrl(url: Uri!): HlsMultivariantPlaylist.Variant!
```

Creates a variant for a given media playlist url.

| Parameters |
|---|---|
| `url: https://developer.android.com/reference/android/net/Uri.html!` | The media playlist url. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist.Variant!` | The variant instance. |

## Public properties

### audioGroupId

```
val audioGroupId: String?
```

The audio rendition group referenced by this variant, or `null`.

### captionGroupId

```
val captionGroupId: String?
```

The caption rendition group referenced by this variant, or `null`.

### format

```
val format: Format!
```

Format information associated with this variant.

### pathwayId

```
val pathwayId: String?
```

The identifier of the pathway that this variant belongs, or `null`.

### stableVariantId

```
val stableVariantId: String?
```

The stable identifier for this variant, or `null`.

### subtitleGroupId

```
val subtitleGroupId: String?
```

The subtitle rendition group referenced by this variant, or `null`.

### url

```
val url: Uri!
```

The variant's url.

### videoGroupId

```
val videoGroupId: String?
```

The video rendition group referenced by this variant, or `null`.