Package 

Class MediaSourceUtil


  • 
    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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 manifest
        trackType - the track type
        format - 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 manifest
        format - 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 type
        format - 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 type
        format - the format