-
public final class MediaSourceUtil
Provides utility method to work with DashManifest and HlsMultivariantPlaylist.
-
-
Method Summary
Modifier and Type Method Description static int
findTrackType(@NonNull() Format format)
Finds the track type of the specified format. static String
findRenditionUrl(@Nullable() Object manifest, int trackType, @NonNull() Format format)
Finds the rendition url from the manifest object given the track type and the format. static String
findRenditionUrl(@Nullable() Object manifest, @NonNull() Format format)
Finds the rendition url from the manifest object given the track type and the format. static String
findRenditionUrl(@NonNull() DashManifest dashManifest, int trackType, @NonNull() Format format)
Finds the rendition url from the DashManifest object for the specified track typeand the format. static Uri
findInitializationUri(@NonNull() Representation representation)
Finds the location of the representation's initialization data. static String
findRenditionUrl(@NonNull() HlsMultivariantPlaylist hlsMasterPlaylist, int trackType, @NonNull() Format format)
Finds the rendition url from the HlsMultivariantPlaylist object for the specified track typeand the format. static int
getBrightcoveRoleFlag(String roleValue)
Gets the Brightcove Role Flag matching the Role Value. static String
getBrightcoveRoleValue(int flag)
Gets the Brightcove Role Value matching the Role Flag. static boolean
isAudioOnly(Tracks tracks)
Check if the Tracks has an audio track and no video track. -
-
Method Detail
-
findTrackType
static int findTrackType(@NonNull() Format format)
Finds the track type of the specified format.
- Parameters:
format
- the format.
-
findRenditionUrl
@Nullable() static String findRenditionUrl(@Nullable() Object manifest, int trackType, @NonNull() Format format)
Finds the rendition url from the manifest object given the track type and the format.The Manifest object needs to be an instance of either DashManifest or HlsManifest.
- Parameters:
manifest
- the manifesttrackType
- the track typeformat
- the format
-
findRenditionUrl
@Nullable() static String findRenditionUrl(@Nullable() Object manifest, @NonNull() Format format)
Finds the rendition url from the manifest object given the track type and the format.The Manifest object needs to be an instance of either DashManifest or HlsManifest.
- Parameters:
manifest
- the manifestformat
- the format
-
findRenditionUrl
@Nullable() static String findRenditionUrl(@NonNull() DashManifest dashManifest, int trackType, @NonNull() Format format)
Finds the rendition url from the DashManifest object for the specified track typeand the format.
- Parameters:
dashManifest
- reference to the DASH manifest.trackType
- the track typeformat
- the format
-
findInitializationUri
@NonNull() static Uri findInitializationUri(@NonNull() Representation representation)
Finds the location of the representation's initialization data. If the representation includesindex data stored adjacent to the initialization uri, the returned URI can be used to requestboth in the same request.
- Parameters:
representation
- reference to the representation
-
findRenditionUrl
@Nullable() static String findRenditionUrl(@NonNull() HlsMultivariantPlaylist hlsMasterPlaylist, int trackType, @NonNull() Format format)
Finds the rendition url from the HlsMultivariantPlaylist object for the specified track typeand the format.
- Parameters:
hlsMasterPlaylist
- reference to the HLS master playlist.trackType
- the track typeformat
- the format
-
getBrightcoveRoleFlag
static int getBrightcoveRoleFlag(String roleValue)
Gets the Brightcove Role Flag matching the Role Value.The com.brightcove.player.dash.BrightcoveDashManifestParser reads theAdaptationSet Role value and adds a Brightcove Flag to the selectionFlags,depending on the Role value.
- Parameters:
roleValue
- the role string value
-
getBrightcoveRoleValue
static String getBrightcoveRoleValue(int flag)
Gets the Brightcove Role Value matching the Role Flag.The com.brightcove.player.dash.BrightcoveDashManifestParser reads theAdaptationSet Role value and adds a Brightcove Flag to the selectionFlags,depending on the Role value.
- Parameters:
flag
- the Brightcove Role Flag
-
isAudioOnly
@RestrictTo(value = RestrictTo.Scope.LIBRARY) static boolean isAudioOnly(Tracks tracks)
Check if the Tracks has an audio track and no video track.
- Parameters:
tracks
- The available tracks information.
-
-
-
-