Package com.brightcove.player.dash
Class DashUtil
- java.lang.Object
-
- com.brightcove.player.dash.DashUtil
-
public class DashUtil extends java.lang.ObjectProvides utility methods related to DASH media description file.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doubleceilDivide(double numerator, double denominator)static com.google.android.exoplayer2.source.dash.manifest.RepresentationfindRepresentationByBitrate(java.util.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.RepresentationgetHighestRepresentation(com.google.android.exoplayer2.source.dash.manifest.AdaptationSet adaptationSet)Utility method to get the highestRepresentationfrom a DASH Adaptation Set based on the bitrate.static com.google.android.exoplayer2.source.dash.manifest.RepresentationgetHighestRepresentation(java.util.List<com.google.android.exoplayer2.source.dash.manifest.Representation> representationList)Utility method to get the highestRepresentationfrom a List of Representation based on the bitrate.static java.lang.StringgetMediaMimeType(com.google.android.exoplayer2.Format format)static MediaFormatgetTrackFormat(int adaptationSetType, com.google.android.exoplayer2.Format format, java.lang.String mediaMimeType, long durationUs)static java.util.List<com.google.android.exoplayer2.source.dash.manifest.Representation>getVideoRepresentationList(android.content.Context context, com.google.android.exoplayer2.source.dash.manifest.AdaptationSet adaptationSet)static voidreplaceVideoSourceUri(Video video, java.lang.String newUrl)Utility method to replaceSource.Fields.URLfrom the video source properties with the new url provided.
-
-
-
Method Detail
-
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 highestRepresentationfrom a DASH Adaptation Set based on the bitrate.- Parameters:
adaptationSet- the adaptation set- Returns:
- the highest rendition Representation.
-
getVideoRepresentationList
public static java.util.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 java.util.List<com.google.android.exoplayer2.source.dash.manifest.Representation> representationList)Utility method to get the highestRepresentationfrom 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 java.util.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
public static void replaceVideoSourceUri(@NonNull Video video, @NonNull java.lang.String newUrl)Utility method to replaceSource.Fields.URLfrom 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, java.lang.String mediaMimeType, long durationUs)
-
getMediaMimeType
public static java.lang.String getMediaMimeType(@Nullable com.google.android.exoplayer2.Format format)
-
ceilDivide
public static double ceilDivide(double numerator, double denominator)
-
-