Package 

Class MediaPlayerPlayback

    • Method Detail

      • getAnalytics

         Analytics getAnalytics()

        Returns the analytics component, the part of the player that monitors andtracks video playback and engagement.

      • setProgressInterval

         void setProgressInterval(int progressInterval)

        Sets the the interval in milliseconds at which to fire PROGRESS events during playback. The default is 500ms.

        Parameters:
        progressInterval - the PROGRESS interval in milliseconds
      • getCurrentIndex

         int getCurrentIndex()

        Gets the index from the current video

      • setCurrentIndex

         void setCurrentIndex(int index)

        Sets the current video to the specified index.

      • openVideo

         void openVideo(@NonNull() Video video, @Nullable() Source source)

        Creates, configures, and prepares a new instance of MediaPlayback

        Parameters:
        video - reference to the video to be prepared for the playback.
        source - reference to the source to played if any.
      • destroyPlayer

         void destroyPlayer()

        Destroys the current player and releases it from memory.This seems wasteful, but helps to mitigate working with the complex state machines that are the MediaPlayer andthe SurfaceView

      • setVideoSource

         void setVideoSource(@Nullable() Video video, @Nullable() Source source)

        Sets the video source that will be used for playback.

        Parameters:
        video - reference to the video, if any.
        source - reference to the video source, if any.
      • isPlayingAudioOnly

         boolean isPlayingAudioOnly()

        Check if the player is currently playing and the media is audio-only.

      • onTaskRemoved

         void onTaskRemoved(Intent rootIntent)

        This is called when the MediaPlaybackService is currentlyrunning and the user has removed a task that comes from the service's application.

        Parameters:
        rootIntent - The original Intent that was used to launch the task that is being removed.
      • hasDvr

         boolean hasDvr()

        Indicates if Live with DVR is supported. Subclasses will override if live with DVR videos are supported.

      • isLive

         boolean isLive()

        Provides a default for handling live videos. Subclasses will override if live videos are supported.

      • getLiveEdge

         long getLiveEdge()

        Obtains the playhead position of the "live edge".

      • isInLiveEdge

         boolean isInLiveEdge()

        Checks the current playhead position with the live edge position and determines if it is in live edge.

      • getCurrentPosition

         long getCurrentPosition()

        Returns the current playhead position of the underlying video player.

        If the player has not been set or initialized, TIME_UNSET will returned.

      • add

         void add(Video video)

        Adds the video to the end of the video list.

      • add

         void add(int index, Video video)

        Adds the video to the video list at the specified index.

      • addAll

         void addAll(Collection<Video> videos)

        Add all videos in the collection to the end of the list.

        Parameters:
        videos - The videos to append.
      • addAll

         void addAll(int index, Collection<Video> videos)

        Inserts all videos in the collection at the specified index.

      • setVideoPath

         Video setVideoPath(String path)

        Replaces player content with the video at the specified path.

        Parameters:
        path - HTTP path to a video
      • setVideoPath

         Video setVideoPath(String videoPath, Map<String, String> languageCodeCaptionsMap)

        Replace player content with the video and captions at the specified paths.

        Parameters:
        videoPath - HTTP path to the video
        languageCodeCaptionsMap - A map of language code to caption urls.
      • getVideoAt

         Video getVideoAt(int index)

        Gets a video from the video list at the specified index

      • remove

         void remove(int index)

        Removes the video at the specified index.

      • clear

         void clear()

        Removes all videos from the list.

      • isSourceSet

         boolean isSourceSet()

        Returns if a source has been set

      • isCurrentVideo360Mode

         boolean isCurrentVideo360Mode()

        Returns true if the video is a 360 video otherwise returns false

      • emitErrorEvent

         void emitErrorEvent(String message)

        Emits an error event with the message passed in the event's properties

      • emitErrorEvent

         void emitErrorEvent(String message, Exception exception)

        Emits an error event including the message passedand the exception in the properties