Package com.brightcove.player.dash
Class DashUtil
java.lang.Object
com.brightcove.player.dash.DashUtil
Provides utility methods related to DASH media description file.
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
ceilDivide
(double numerator, double denominator) static com.google.android.exoplayer2.source.dash.manifest.Representation
findRepresentationByBitrate
(List<com.google.android.exoplayer2.source.dash.manifest.Representation> representationList, int bitrate) Finds the highest Representation bitrate up to the the bitrate provided.static com.google.android.exoplayer2.source.dash.manifest.Representation
getHighestRepresentation
(com.google.android.exoplayer2.source.dash.manifest.AdaptationSet adaptationSet) Utility method to get the highestRepresentation
from a DASH Adaptation Set based on the bitrate.static com.google.android.exoplayer2.source.dash.manifest.Representation
getHighestRepresentation
(List<com.google.android.exoplayer2.source.dash.manifest.Representation> representationList) Utility method to get the highestRepresentation
from a List of Representation based on the bitrate.static String
getMediaMimeType
(com.google.android.exoplayer2.Format format) static MediaFormat
getTrackFormat
(int adaptationSetType, com.google.android.exoplayer2.Format format, String mediaMimeType, long durationUs) static List<com.google.android.exoplayer2.source.dash.manifest.Representation>
getVideoRepresentationList
(android.content.Context context, com.google.android.exoplayer2.source.dash.manifest.AdaptationSet adaptationSet) static void
replaceVideoSourceUri
(Video video, String newUrl) Utility method to replaceSource.Fields.URL
from the video source properties with the new url provided.
-
Method Details
-
getHighestRepresentation
@Nullable public static com.google.android.exoplayer2.source.dash.manifest.Representation getHighestRepresentation(@NonNull com.google.android.exoplayer2.source.dash.manifest.AdaptationSet adaptationSet) Utility method to get the highestRepresentation
from a DASH Adaptation Set based on the bitrate.- Parameters:
adaptationSet
- the adaptation set- Returns:
- the highest rendition Representation.
-
getVideoRepresentationList
public static List<com.google.android.exoplayer2.source.dash.manifest.Representation> getVideoRepresentationList(@NonNull android.content.Context context, com.google.android.exoplayer2.source.dash.manifest.AdaptationSet adaptationSet) -
getHighestRepresentation
@Nullable public static com.google.android.exoplayer2.source.dash.manifest.Representation getHighestRepresentation(@NonNull List<com.google.android.exoplayer2.source.dash.manifest.Representation> representationList) Utility method to get the highestRepresentation
from a List of Representation based on the bitrate.- Parameters:
representationList
- the List of representation- Returns:
- the highest rendition Representation.
-
findRepresentationByBitrate
@Nullable public static com.google.android.exoplayer2.source.dash.manifest.Representation findRepresentationByBitrate(@NonNull List<com.google.android.exoplayer2.source.dash.manifest.Representation> representationList, int bitrate) Finds the highest Representation bitrate up to the the bitrate provided. If no rendition is found, the next higher will be picked.- Parameters:
representationList
- the representation listbitrate
- the bitrate- Returns:
- the representation
-
replaceVideoSourceUri
Utility method to replaceSource.Fields.URL
from the video source properties with the new url provided.- Parameters:
video
- the videonewUrl
- the new url
-
getTrackFormat
@Nullable public static MediaFormat getTrackFormat(int adaptationSetType, com.google.android.exoplayer2.Format format, String mediaMimeType, long durationUs) -
getMediaMimeType
-
ceilDivide
public static double ceilDivide(double numerator, double denominator)
-