Class DashUtil

java.lang.Object
com.brightcove.player.dash.DashUtil

public class DashUtil extends Object
Provides utility methods related to DASH media description file.
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 highest Representation 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 highest Representation from a List of Representation based on the bitrate.
    static String
    getMediaMimeType(com.google.android.exoplayer2.Format format)
     
    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
    Utility method to replace Source.Fields.URL from the video source properties with the new url provided.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 highest Representation 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 highest Representation 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 list
      bitrate - the bitrate
      Returns:
      the representation
    • replaceVideoSourceUri

      public static void replaceVideoSourceUri(@NonNull Video video, @NonNull String newUrl)
      Utility method to replace Source.Fields.URL from the video source properties with the new url provided.
      Parameters:
      video - the video
      newUrl - the new url
    • getTrackFormat

      @Nullable public static MediaFormat getTrackFormat(int adaptationSetType, com.google.android.exoplayer2.Format format, String mediaMimeType, long durationUs)
    • getMediaMimeType

      public static String getMediaMimeType(@Nullable com.google.android.exoplayer2.Format format)
    • ceilDivide

      public static double ceilDivide(double numerator, double denominator)