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 String
getAudioString()
Returns a string containing audio debugging information.protected String
getDebugString()
Returns the debugging information string to be shown by the targetTextView
.protected String
getPlayerStateString()
Returns a string containing player state debugging information.protected String
getVideoString()
Returns a string containing video debugging information.void
onPlaybackStateChanged(@com.google.android.exoplayer2.Player.State int playbackState)
Called when the value returned fromPlayer.getPlaybackState()
changes.void
onPlayWhenReadyChanged(boolean playWhenReady, @com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int reason)
Called when the value returned fromPlayer.getPlayWhenReady()
changes.void
onPositionDiscontinuity(Player.PositionInfo oldPosition, Player.PositionInfo newPosition, @com.google.android.exoplayer2.Player.DiscontinuityReason int reason)
Called when a position discontinuity occurs.void
run()
void
start()
Starts periodic updates of theTextView
.void
stop()
Stops periodic updates of theTextView
.protected void
updateAndPost()
-
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.Listener
Called 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 sameLooper
message queue iteration.- Specified by:
onPlaybackStateChanged
in 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.Listener
Called 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 sameLooper
message queue iteration.- Specified by:
onPlayWhenReadyChanged
in interfacePlayer.Listener
- Parameters:
playWhenReady
- Whether playback will proceed when ready.reason
- Thereason
for 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.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 sameLooper
message queue iteration.- Specified by:
onPositionDiscontinuity
in interfacePlayer.Listener
- Parameters:
oldPosition
- The position before the discontinuity.newPosition
- The position after the discontinuity.reason
- ThePlayer.DiscontinuityReason
responsible 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.
-
-