Class DebugTextViewHelper
- java.lang.Object
-
- com.google.android.exoplayer2.util.DebugTextViewHelper
-
- All Implemented Interfaces:
Player.Listener,Runnable
public class DebugTextViewHelper extends Object implements Player.Listener, Runnable
-
-
Constructor Summary
Constructors Constructor Description DebugTextViewHelper(ExoPlayer player, TextView textView)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetAudioString()Returns a string containing audio debugging information.protected StringgetDebugString()Returns the debugging information string to be shown by the targetTextView.protected StringgetPlayerStateString()Returns a string containing player state debugging information.protected StringgetVideoString()Returns a string containing video debugging information.voidonPlaybackStateChanged(@com.google.android.exoplayer2.Player.State int playbackState)Called when the value returned fromPlayer.getPlaybackState()changes.voidonPlayWhenReadyChanged(boolean playWhenReady, @com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int reason)Called when the value returned fromPlayer.getPlayWhenReady()changes.voidonPositionDiscontinuity(Player.PositionInfo oldPosition, Player.PositionInfo newPosition, @com.google.android.exoplayer2.Player.DiscontinuityReason int reason)Called when a position discontinuity occurs.voidrun()voidstart()Starts periodic updates of theTextView.voidstop()Stops periodic updates of theTextView.protected voidupdateAndPost()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.Player.Listener
onAudioAttributesChanged, onAudioSessionIdChanged, onAvailableCommandsChanged, onCues, onDeviceInfoChanged, onDeviceVolumeChanged, onEvents, onIsLoadingChanged, onIsPlayingChanged, onLoadingChanged, onMaxSeekToPreviousPositionChanged, onMediaItemTransition, onMediaMetadataChanged, onMetadata, onPlaybackParametersChanged, onPlaybackSuppressionReasonChanged, onPlayerError, onPlayerErrorChanged, onPlayerStateChanged, onPlaylistMetadataChanged, onPositionDiscontinuity, onRenderedFirstFrame, onRepeatModeChanged, onSeekBackIncrementChanged, onSeekForwardIncrementChanged, onSeekProcessed, onShuffleModeEnabledChanged, onSkipSilenceEnabledChanged, onSurfaceSizeChanged, onTimelineChanged, onTracksChanged, onTrackSelectionParametersChanged, onTracksInfoChanged, onVideoSizeChanged, onVolumeChanged
-
-
-
-
Method Detail
-
start
public final void start()
Starts periodic updates of theTextView. Must be called from the application's main thread.
-
stop
public final void stop()
Stops periodic updates of theTextView. Must be called from the application's main thread.
-
onPlaybackStateChanged
public final void onPlaybackStateChanged(@State @com.google.android.exoplayer2.Player.State int playbackState)
Description copied from interface:Player.ListenerCalled when the value returned fromPlayer.getPlaybackState()changes.Player.Listener.onEvents(Player, Events)will also be called to report this event along with other events that happen in the sameLoopermessage queue iteration.- Specified by:
onPlaybackStateChangedin interfacePlayer.Listener- Parameters:
playbackState- The new playbackstate.
-
onPlayWhenReadyChanged
public final void onPlayWhenReadyChanged(boolean playWhenReady, @PlayWhenReadyChangeReason @com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int reason)Description copied from interface:Player.ListenerCalled when the value returned fromPlayer.getPlayWhenReady()changes.Player.Listener.onEvents(Player, Events)will also be called to report this event along with other events that happen in the sameLoopermessage queue iteration.- Specified by:
onPlayWhenReadyChangedin interfacePlayer.Listener- Parameters:
playWhenReady- Whether playback will proceed when ready.reason- Thereasonfor the change.
-
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.ListenerCalled 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 sameLoopermessage queue iteration.- Specified by:
onPositionDiscontinuityin interfacePlayer.Listener- Parameters:
oldPosition- The position before the discontinuity.newPosition- The position after the discontinuity.reason- ThePlayer.DiscontinuityReasonresponsible for the discontinuity.
-
updateAndPost
protected final void updateAndPost()
-
getDebugString
protected String getDebugString()
Returns the debugging information string to be shown by the targetTextView.
-
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.
-
-