Class HlsMasterPlaylist
- java.lang.Object
-
- com.google.android.exoplayer2.source.hls.playlist.HlsPlaylist
-
- com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist
-
- All Implemented Interfaces:
FilterableManifest<HlsPlaylist>
public final class HlsMasterPlaylist extends HlsPlaylist
Represents an HLS master playlist.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHlsMasterPlaylist.RenditionA rendition (i.e.static classHlsMasterPlaylist.VariantA variant (i.e.
-
Field Summary
Fields Modifier and Type Field Description List<HlsMasterPlaylist.Rendition>audiosThe audio renditions declared by the playlist.List<HlsMasterPlaylist.Rendition>closedCaptionsThe closed caption renditions declared by the playlist.static HlsMasterPlaylistEMPTYRepresents an empty master playlist, from which no attributes can be inherited.static intGROUP_INDEX_AUDIOstatic intGROUP_INDEX_SUBTITLEstatic intGROUP_INDEX_VARIANTList<Uri>mediaPlaylistUrlsAll of the media playlist URLs referenced by the playlist.FormatmuxedAudioFormatThe format of the audio muxed in the variants.List<Format>muxedCaptionFormatsThe format of the closed captions declared by the playlist.List<DrmInitData>sessionKeyDrmInitDataDRM initialization data derived from #EXT-X-SESSION-KEY tags.List<HlsMasterPlaylist.Rendition>subtitlesThe subtitle renditions declared by the playlist.Map<String,String>variableDefinitionsContains variable definitions, as defined by the #EXT-X-DEFINE tag.List<HlsMasterPlaylist.Variant>variantsThe variants declared by the playlist.List<HlsMasterPlaylist.Rendition>videosThe video renditions declared by the playlist.-
Fields inherited from class com.google.android.exoplayer2.source.hls.playlist.HlsPlaylist
baseUri, hasIndependentSegments, tags
-
-
Constructor Summary
Constructors Constructor Description HlsMasterPlaylist(String baseUri, List<String> tags, List<HlsMasterPlaylist.Variant> variants, List<HlsMasterPlaylist.Rendition> videos, List<HlsMasterPlaylist.Rendition> audios, List<HlsMasterPlaylist.Rendition> subtitles, List<HlsMasterPlaylist.Rendition> closedCaptions, Format muxedAudioFormat, List<Format> muxedCaptionFormats, boolean hasIndependentSegments, Map<String,String> variableDefinitions, List<DrmInitData> sessionKeyDrmInitData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HlsMasterPlaylistcopy(List<StreamKey> streamKeys)Returns a copy of the manifest including only the streams specified by the given keys.static HlsMasterPlaylistcreateSingleVariantMasterPlaylist(String variantUrl)Creates a playlist with a single variant.
-
-
-
Field Detail
-
EMPTY
public static final HlsMasterPlaylist EMPTY
Represents an empty master playlist, from which no attributes can be inherited.
-
GROUP_INDEX_VARIANT
public static final int GROUP_INDEX_VARIANT
- See Also:
- Constant Field Values
-
GROUP_INDEX_AUDIO
public static final int GROUP_INDEX_AUDIO
- See Also:
- Constant Field Values
-
GROUP_INDEX_SUBTITLE
public static final int GROUP_INDEX_SUBTITLE
- See Also:
- Constant Field Values
-
mediaPlaylistUrls
public final List<Uri> mediaPlaylistUrls
All of the media playlist URLs referenced by the playlist.
-
variants
public final List<HlsMasterPlaylist.Variant> variants
The variants declared by the playlist.
-
videos
public final List<HlsMasterPlaylist.Rendition> videos
The video renditions declared by the playlist.
-
audios
public final List<HlsMasterPlaylist.Rendition> audios
The audio renditions declared by the playlist.
-
subtitles
public final List<HlsMasterPlaylist.Rendition> subtitles
The subtitle renditions declared by the playlist.
-
closedCaptions
public final List<HlsMasterPlaylist.Rendition> closedCaptions
The closed caption renditions declared by the playlist.
-
muxedAudioFormat
@Nullable public final Format muxedAudioFormat
The format of the audio muxed in the variants. May be null if the playlist does not declare any muxed audio.
-
muxedCaptionFormats
@Nullable public final List<Format> muxedCaptionFormats
The format of the closed captions declared by the playlist. May be empty if the playlist explicitly declares no captions are available, or null if the playlist does not declare any captions information.
-
variableDefinitions
public final Map<String,String> variableDefinitions
Contains variable definitions, as defined by the #EXT-X-DEFINE tag.
-
sessionKeyDrmInitData
public final List<DrmInitData> sessionKeyDrmInitData
DRM initialization data derived from #EXT-X-SESSION-KEY tags.
-
-
Constructor Detail
-
HlsMasterPlaylist
public HlsMasterPlaylist(String baseUri, List<String> tags, List<HlsMasterPlaylist.Variant> variants, List<HlsMasterPlaylist.Rendition> videos, List<HlsMasterPlaylist.Rendition> audios, List<HlsMasterPlaylist.Rendition> subtitles, List<HlsMasterPlaylist.Rendition> closedCaptions, @Nullable Format muxedAudioFormat, @Nullable List<Format> muxedCaptionFormats, boolean hasIndependentSegments, Map<String,String> variableDefinitions, List<DrmInitData> sessionKeyDrmInitData)
- Parameters:
baseUri- SeeHlsPlaylist.baseUri.tags- SeeHlsPlaylist.tags.variants- Seevariants.videos- Seevideos.audios- Seeaudios.subtitles- Seesubtitles.closedCaptions- SeeclosedCaptions.muxedAudioFormat- SeemuxedAudioFormat.muxedCaptionFormats- SeemuxedCaptionFormats.hasIndependentSegments- SeeHlsPlaylist.hasIndependentSegments.variableDefinitions- SeevariableDefinitions.sessionKeyDrmInitData- SeesessionKeyDrmInitData.
-
-
Method Detail
-
copy
public HlsMasterPlaylist copy(List<StreamKey> streamKeys)
Description copied from interface:FilterableManifestReturns a copy of the manifest including only the streams specified by the given keys. If the manifest is unchanged then the instance may return itself.- Parameters:
streamKeys- A non-empty list of stream keys.- Returns:
- The filtered manifest.
-
createSingleVariantMasterPlaylist
public static HlsMasterPlaylist createSingleVariantMasterPlaylist(String variantUrl)
Creates a playlist with a single variant.- Parameters:
variantUrl- The url of the single variant.- Returns:
- A master playlist with a single variant for the provided url.
-
-