Class POBMediaPlayer

    • Constructor Detail

      • POBMediaPlayer

        POBMediaPlayer(String uri, Handler callbackHandler)
        Create a new media player instance and load video in background
        Parameters:
        uri - video url
        callbackHandler - handler to provide POBPlayerListener callbacks
    • Method Detail

      • getVideoWidth

         int getVideoWidth()

        Get video player width

        Returns:

        video player width

      • getVideoHeight

         int getVideoHeight()

        Get video player height

        Returns:

        video player height

      • start

         void start()

        Start current playback.

      • pause

         void pause()

        Pauses current playback.

      • stop

         void stop()

        Stops playback after playback has been onStart or onPause.

      • setVolume

         void setVolume(int leftVolume, int rightVolume)

        Set audio volume of Player

        Parameters:
        leftVolume - left volume
        rightVolume - right volume
      • getDuration

         int getDuration()

        Gets the duration of the media.

        Returns:

        the duration in milliseconds, if no duration is available (for example, if streaming live content), -1 is returned.

      • destroy

         void destroy()

        Method to do resource cleanup

      • onBufferingUpdate

         void onBufferingUpdate(MediaPlayer mp, int percent)

        Called to update status in buffering a media stream received through progressive HTTP download. The received buffering percentage indicates how much of the content has been buffered or played. For example a buffering update of 80 percent when half the content has already been played indicates that the next 30 percent of the content to play has been buffered.

        Parameters:
        mp - the MediaPlayer the update pertains to
        percent - the percentage (0-100) of the content
      • onCompletion

         void onCompletion(MediaPlayer mp)

        Called when the end of a media source is reached during playback.

        Parameters:
        mp - the MediaPlayer that reached the end of the file
      • onPrepared

         void onPrepared(MediaPlayer mp)

        Called when the media file is ready for playback.

        Parameters:
        mp - the MediaPlayer that is ready for playback
      • setPrepareTimeout

         void setPrepareTimeout(int prepareTimeout)

        Set prepare timeout to handle Player url loading.

      • setStallTimeout

         void setStallTimeout(int stallTimeout)

        Set stall timeout to handle Player buffering.

        Parameters:
        stallTimeout - the timeout value in milliseconds.