@UnstableApi
class HlsRedundantGroup


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

Defines a key that groups variants or renditions into one HlsRedundantGroup.

Represents the type of a HlsRedundantGroup.

Public constructors

HlsRedundantGroup(
    groupKey: HlsRedundantGroup.GroupKey!,
    pathwayId: String!,
    playlistUrl: Uri!
)

Creates a HlsRedundantGroup.

Public functions

java-static ImmutableList<HlsRedundantGroup!>!

Creates a list of redundant groups for renditions.

java-static ImmutableList<HlsRedundantGroup!>!

Creates a list of redundant groups for variants.

ImmutableSet<String!>!

Returns all pathway IDs that belong to this HlsRedundantGroup.

ImmutableSet<Uri!>!

Returns all playlist urls that belong to this HlsRedundantGroup.

Uri!

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

Uri?
getPlaylistUrl(pathwayId: String!)

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

Unit
put(pathwayId: String!, playlistUrl: Uri!)

Puts a playlistUrl and its associated pathwayId to the HlsRedundantGroup.

Int

Returns the size of the HlsRedundantGroup.

Constants

AUDIO_RENDITION

@HlsRedundantGroup.Type
const val AUDIO_RENDITION = 2: Int

The HlsRedundantGroup groups audio renditions.

SUBTITLE_RENDITION

@HlsRedundantGroup.Type
const val SUBTITLE_RENDITION = 3: Int

The HlsRedundantGroup groups subtitle renditions.

VARIANT

@HlsRedundantGroup.Type
const val VARIANT = 0: Int

The HlsRedundantGroup groups variants.

VIDEO_RENDITION

@HlsRedundantGroup.Type
const val VIDEO_RENDITION = 1: Int

The HlsRedundantGroup groups video renditions.

Public constructors

HlsRedundantGroup

HlsRedundantGroup(
    groupKey: HlsRedundantGroup.GroupKey!,
    pathwayId: String!,
    playlistUrl: Uri!
)

Creates a HlsRedundantGroup.

Parameters
groupKey: HlsRedundantGroup.GroupKey!

See groupKey.

pathwayId: String!

The ID of the default current pathway.

playlistUrl: Uri!

The playlist url that is associated with the default current pathway.

Public functions

createRenditionRedundantGroupList

java-static fun createRenditionRedundantGroupList(
    renditions: (Mutable)List<HlsMultivariantPlaylist.Rendition!>!
): ImmutableList<HlsRedundantGroup!>!

Creates a list of redundant groups for renditions.

For each Rendition with a non-null url, a generated pathway ID will be used. The first is '.', and the subsequent ones for the same group are '..', '...', according to the order they are listed in the HlsMultivariantPlaylist.

Parameters
renditions: (Mutable)List<HlsMultivariantPlaylist.Rendition!>!

The renditions.

createVariantRedundantGroupList

java-static fun createVariantRedundantGroupList(
    variants: (Mutable)List<HlsMultivariantPlaylist.Variant!>!
): ImmutableList<HlsRedundantGroup!>!

Creates a list of redundant groups for variants.

If a Variant has a non-null pathway ID, then its url will be associated with that pathway ID when added to the HlsRedundantGroup. Otherwise, a generated pathway ID will be used. The first is '.', and the subsequent ones for the same group are '..', '...', according to the order they are listed in the HlsMultivariantPlaylist.

Parameters
variants: (Mutable)List<HlsMultivariantPlaylist.Variant!>!

The variants.

Throws
androidx.media3.common.ParserException

If two variants grouped into one HlsRedundantGroup have the same pathwayId but different urls.

getAllPathwayIds

fun getAllPathwayIds(): ImmutableSet<String!>!

Returns all pathway IDs that belong to this HlsRedundantGroup.

getAllPlaylistUrls

fun getAllPlaylistUrls(): ImmutableSet<Uri!>!

Returns all playlist urls that belong to this HlsRedundantGroup.

getCurrentPlaylistUrl

fun getCurrentPlaylistUrl(): Uri!

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

getPlaylistUrl

fun getPlaylistUrl(pathwayId: String!): Uri?

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

put

fun put(pathwayId: String!, playlistUrl: Uri!): Unit

Puts a playlistUrl and its associated pathwayId to the HlsRedundantGroup.

size

fun size(): Int

Returns the size of the HlsRedundantGroup.

Public properties

currentPathwayId

var currentPathwayIdString!