-
public class DashUtil
Provides utility methods related to DASH media description file.
-
-
Field Summary
Fields Modifier and Type Field Description private final static List<Pair<String, String>>
contentProtectionAttributes
-
Method Summary
Modifier and Type Method Description static List<Pair<String, String>>
getContentProtectionAttributes()
static Representation
getHighestRepresentation(@NonNull() AdaptationSet adaptationSet)
Utility method to get the highest Representation from a DASH Adaptation Set based on the bitrate. static List<Representation>
getVideoRepresentationList(@NonNull() Context context, AdaptationSet adaptationSet)
static Representation
getHighestRepresentation(@NonNull() List<Representation> representationList)
Utility method to get the highest Representation from a List of Representation based on the bitrate. static Representation
findRepresentationByBitrate(@NonNull() List<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. static void
replaceVideoSourceUri(@NonNull() Video video, @NonNull() String newUrl)
Utility method to replace URL from the video source propertieswith the new url provided. static MediaFormat
getTrackFormat(int adaptationSetType, Format format, String mediaMimeType, long durationUs)
static String
getMediaMimeType(@Nullable() Format format)
static double
ceilDivide(double numerator, double denominator)
static List<String>
getAllContentProtectionAttributesWithName(String name)
static String
getCaptionsURLFromDASHManifest(DashManifest manifest, String id)
-
-
Method Detail
-
getContentProtectionAttributes
static List<Pair<String, String>> getContentProtectionAttributes()
-
getHighestRepresentation
@Nullable() static Representation getHighestRepresentation(@NonNull() AdaptationSet adaptationSet)
Utility method to get the highest Representation from a DASH Adaptation Set based on the bitrate.
- Parameters:
adaptationSet
- the adaptation set
-
getVideoRepresentationList
static List<Representation> getVideoRepresentationList(@NonNull() Context context, AdaptationSet adaptationSet)
-
getHighestRepresentation
@Nullable() static Representation getHighestRepresentation(@NonNull() List<Representation> representationList)
Utility method to get the highest Representation from a List of Representation based on the bitrate.
- Parameters:
representationList
- the List of representation
-
findRepresentationByBitrate
@Nullable() static Representation findRepresentationByBitrate(@NonNull() List<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
-
replaceVideoSourceUri
static void replaceVideoSourceUri(@NonNull() Video video, @NonNull() String newUrl)
Utility method to replace URL from the video source propertieswith the new url provided.
- Parameters:
video
- the videonewUrl
- the new url
-
getTrackFormat
@Nullable() static MediaFormat getTrackFormat(int adaptationSetType, Format format, String mediaMimeType, long durationUs)
-
getMediaMimeType
static String getMediaMimeType(@Nullable() Format format)
-
ceilDivide
static double ceilDivide(double numerator, double denominator)
-
getAllContentProtectionAttributesWithName
static List<String> getAllContentProtectionAttributesWithName(String name)
-
getCaptionsURLFromDASHManifest
static String getCaptionsURLFromDASHManifest(DashManifest manifest, String id)
-
-
-
-