Class DebugTextViewHelper

    • Constructor Detail

      • DebugTextViewHelper

        public DebugTextViewHelper​(ExoPlayer player,
                                   TextView textView)
        Parameters:
        player - The ExoPlayer from which debug information should be obtained. Only players which are accessed on the main thread are supported ( player.getApplicationLooper() == Looper.getMainLooper()).
        textView - The TextView that should be updated to display the information.
    • Method Detail

      • start

        public final void start()
        Starts periodic updates of the TextView. Must be called from the application's main thread.
      • stop

        public final void stop()
        Stops periodic updates of the TextView. Must be called from the application's main thread.
      • onPositionDiscontinuity

        public final void onPositionDiscontinuity​(Player.PositionInfo oldPosition,
                                                  Player.PositionInfo newPosition,
                                                  @DiscontinuityReason
                                                  @com.google.android.exoplayer2.Player.DiscontinuityReason int reason)
        Description copied from interface: Player.Listener
        Called when a position discontinuity occurs.

        A position discontinuity occurs when the playing period changes, the playback position jumps within the period currently being played, or when the playing period has been skipped or removed.

        Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.

        Specified by:
        onPositionDiscontinuity in interface Player.Listener
        Parameters:
        oldPosition - The position before the discontinuity.
        newPosition - The position after the discontinuity.
        reason - The Player.DiscontinuityReason responsible for the discontinuity.
      • run

        public final void run()
        Specified by:
        run in interface Runnable
      • updateAndPost

        protected final void updateAndPost()
      • getDebugString

        protected String getDebugString()
        Returns the debugging information string to be shown by the target TextView.
      • getPlayerStateString

        protected String getPlayerStateString()
        Returns a string containing player state debugging information.
      • getVideoString

        protected String getVideoString()
        Returns a string containing video debugging information.
      • getAudioString

        protected String getAudioString()
        Returns a string containing audio debugging information.