@UnstableApi
public final 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

A factory for creating lists of redundant groups from a HlsMultivariantPlaylist.

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

Represents the type of a HlsRedundantGroup.

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>

Returns all pathway IDs that belong to this HlsRedundantGroup.

ImmutableSet<Uri>

Returns all playlist urls that belong to this HlsRedundantGroup.

String

Returns the pathway ID that is currently chosen for playback.

Uri

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

ImmutableList<Integer>

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

@Nullable Uri

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

Sets the pathwayId that is currently chosen for playback.

int

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<StringgetAllPathwayIds()

Returns all pathway IDs that belong to this HlsRedundantGroup.

getAllPlaylistUrls

public ImmutableSet<UrigetAllPlaylistUrls()

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<IntegergetIndicesInMultivariantPlaylist()

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.