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

# HlsRedundantGroup

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

*** ** * ** ***


```
@UnstableApi
public final class HlsRedundantGroup
```

<br />

*** ** * ** ***

Represents a group of `variants` or `renditions` that are identical streams but from different locations (different playlist urls), and indicated by a shared `GroupKey`.

## Summary

| ### Nested types |
|---|
| `public class HlsRedundantGroup.Factory` A factory for creating lists of `redundant groups` from a `HlsMultivariantPlaylist`. |
| `public class HlsRedundantGroup.GroupKey` Defines a key that groups `variants` or `renditions` into one `HlsRedundantGroup`. |
| `@Documented @Retention(value = RetentionPolicy.SOURCE) @Target(value = ElementType.TYPE_USE) @IntDef(value = ) public annotation HlsRedundantGroup.Type` Represents the type of a `HlsRedundantGroup`. |

| ### Constants |
|---|---|
| `static final int` | `@HlsRedundantGroup.Type AUDIO_RENDITION = 2` The `HlsRedundantGroup` groups `audio renditions`. |
| `static final int` | `@HlsRedundantGroup.Type SUBTITLE_RENDITION = 3` The `HlsRedundantGroup` groups `subtitle renditions`. |
| `static final int` | `@HlsRedundantGroup.Type VARIANT = 0` The `HlsRedundantGroup` groups `variants`. |
| `static final int` | `@HlsRedundantGroup.Type VIDEO_RENDITION = 1` The `HlsRedundantGroup` groups `video renditions`. |

| ### Public fields |
|---|---|
| `String` | `currentPathwayId` |
| `final HlsRedundantGroup.GroupKey` | `groupKey` The `GroupKey` that the `grouped variants` or `grouped renditions` share. |

| ### Public constructors |
|---|
| `HlsRedundantGroup( HlsRedundantGroup.GroupKey groupKey, String pathwayId, Uri playlistUrl )` Creates a `HlsRedundantGroup`. |
| `HlsRedundantGroup( HlsRedundantGroup.GroupKey groupKey, String pathwayId, Uri playlistUrl, int indexInMultivariantPlaylist )` Creates a `HlsRedundantGroup`. |

| ### Public methods |
|---|---|
| `ImmutableSet<String>` | `getAllPathwayIds()` Returns all pathway IDs that belong to this `HlsRedundantGroup`. |
| `ImmutableSet<Uri>` | `getAllPlaylistUrls()` Returns all playlist urls that belong to this `HlsRedundantGroup`. |
| `String` | `getCurrentPathwayId()` Returns the pathway ID that is currently chosen for playback. |
| `Uri` | `getCurrentPlaylistUrl()` Returns the playlist url that is associated with the currently chosen pathway ID. |
| `ImmutableList<Integer>` | `getIndicesInMultivariantPlaylist()` Returns the indices of the `variants` or `renditions` belonging to this `HlsRedundantGroup` in either `variants`, `videos`, `audios` or `subtitles`. |
| `@Nullable Uri` | `getPlaylistUrl(String pathwayId)` Returns the playlist url associated with the given `pathwayId`, or `null` if the given `pathwayId` doesn't exist in this `HlsRedundantGroup`. |
| `void` | `put(String pathwayId, Uri playlistUrl)` Puts a `playlistUrl` and its associated `pathwayId` to the `HlsRedundantGroup`. |
| `void` | `put(String pathwayId, Uri playlistUrl, int indexInMultivariantPlaylist)` Puts a `playlistUrl` and its associated `pathwayId` to the `HlsRedundantGroup`. |
| `void` | `setCurrentPathwayId(String pathwayId)` Sets the `pathwayId` that is currently chosen for playback. |
| `int` | `size()` Returns the size of the `HlsRedundantGroup`. |

## Constants

### AUDIO_RENDITION

```
@HlsRedundantGroup.Type
public static final int AUDIO_RENDITION = 2
```

The `HlsRedundantGroup` groups `audio renditions`.

### SUBTITLE_RENDITION

```
@HlsRedundantGroup.Type
public static final int SUBTITLE_RENDITION = 3
```

The `HlsRedundantGroup` groups `subtitle renditions`.

### VARIANT

```
@HlsRedundantGroup.Type
public static final int VARIANT = 0
```

The `HlsRedundantGroup` groups `variants`.

### VIDEO_RENDITION

```
@HlsRedundantGroup.Type
public static final int VIDEO_RENDITION = 1
```

The `HlsRedundantGroup` groups `video renditions`.

## Public fields

### currentPathwayId

```
public String currentPathwayId
```

### groupKey

```
public final HlsRedundantGroup.GroupKey groupKey
```

The `GroupKey` that the `grouped variants` or `grouped renditions` share.

## Public constructors

### HlsRedundantGroup

```
public HlsRedundantGroup(
    HlsRedundantGroup.GroupKey groupKey,
    String pathwayId,
    Uri playlistUrl
)
```

Creates a `HlsRedundantGroup`.

| Parameters |
|---|---|
| `HlsRedundantGroup.GroupKey groupKey` | See `groupKey`. |
| `String pathwayId` | The ID of the default current pathway. |
| `Uri playlistUrl` | The playlist url that is associated with the default current pathway. |

### HlsRedundantGroup

```
public HlsRedundantGroup(
    HlsRedundantGroup.GroupKey groupKey,
    String pathwayId,
    Uri playlistUrl,
    int indexInMultivariantPlaylist
)
```

Creates a `HlsRedundantGroup`.

| Parameters |
|---|---|
| `HlsRedundantGroup.GroupKey groupKey` | See `groupKey`. |
| `String pathwayId` | The ID of the default current pathway. |
| `Uri playlistUrl` | The playlist url that is associated with the default current pathway. |
| `int indexInMultivariantPlaylist` | The index of the `playlistUrl` in either `variants`, `videos`, `audios` or `subtitles`. May be `INDEX_UNSET` if the `playlistUrl` is not declared in the multivariant playlist. |

## Public methods

### getAllPathwayIds

```
public ImmutableSet<String> getAllPathwayIds()
```

Returns all pathway IDs that belong to this `HlsRedundantGroup`.

### getAllPlaylistUrls

```
public ImmutableSet<Uri> getAllPlaylistUrls()
```

Returns all playlist urls that belong to this `HlsRedundantGroup`.

### getCurrentPathwayId

```
public String getCurrentPathwayId()
```

Returns the pathway ID that is currently chosen for playback.

### getCurrentPlaylistUrl

```
public Uri getCurrentPlaylistUrl()
```

Returns the playlist url that is associated with the currently chosen pathway ID.

### getIndicesInMultivariantPlaylist

```
public ImmutableList<Integer> getIndicesInMultivariantPlaylist()
```

Returns the indices of the `variants` or `renditions` belonging to this `HlsRedundantGroup` in either `variants`, `videos`, `audios` or `subtitles`.

### getPlaylistUrl

```
public @Nullable Uri getPlaylistUrl(String pathwayId)
```

Returns the playlist url associated with the given `pathwayId`, or `null` if the given `pathwayId` doesn't exist in this `HlsRedundantGroup`.

### put

```
public void put(String pathwayId, Uri playlistUrl)
```

Puts a `playlistUrl` and its associated `pathwayId` to the `HlsRedundantGroup`.

### put

```
public void put(String pathwayId, Uri playlistUrl, int indexInMultivariantPlaylist)
```

Puts a `playlistUrl` and its associated `pathwayId` to the `HlsRedundantGroup`.

| Parameters |
|---|---|
| `String pathwayId` | The ID of the pathway to add. |
| `Uri playlistUrl` | The playlist url to add. |
| `int indexInMultivariantPlaylist` | The index of the `playlistUrl` in either `variants`, `videos`, `audios` or `subtitles`. May be `INDEX_UNSET` if the `playlistUrl` is not declared in the multivariant playlist. |

### setCurrentPathwayId

```
public void setCurrentPathwayId(String pathwayId)
```

Sets the `pathwayId` that is currently chosen for playback.

### size

```
public int size()
```

Returns the size of the `HlsRedundantGroup`.