Package 

Interface MediaDownloadable.MediaFormatListener


  • 
    public interface MediaDownloadable.MediaFormatListener
    
                        

    Interface definition for a callback to be invoked when the video tracks have been readand are available. The tracks include Video renditions, audio languages and captions.

    • Method Summary

      Modifier and Type Method Description
      abstract void onResult(MediaDownloadable mediaDownloadable, Bundle mediaFormatBundle) Method to be called when the tracks are available.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onResult

         abstract void onResult(MediaDownloadable mediaDownloadable, Bundle mediaFormatBundle)

        Method to be called when the tracks are available.By using the mediaFormatBundle, you can get the tracks by using the keys VIDEO_RENDITIONS, AUDIO_LANGUAGES and CAPTIONS which will return a Parcelable ArrayList.

        ex. ArrayListaudio = mediaFormatBundle.getParcelableArrayList(MediaDownloadable.AUDIO_LANGUAGES);

        Sometimes the audio has additional information as the role, such as 'main', 'alternate', commentary, etc.but that information can't be retrieved from the MediaFormat object. To get that information you need to usethe key AUDIO_LANGUAGE_ROLES to get an ArrayList. The size and indexes of the array matchesthose of the ArrayList returned by .

        ex. ArrayListaudioRoles = mediaFormatBundle.getStringArrayList(AUDIO_LANGUAGE_ROLES);If an audio doesn't have a role, it will have an empty string.

        Parameters:
        mediaFormatBundle - the bundle having the tracks