Player.EventListener, Runnablepublic class DebugTextViewHelper extends Object implements Player.EventListener, Runnable
TextView with debug information obtained from
a SimpleExoPlayer.| Constructor | Description |
|---|---|
DebugTextViewHelper(SimpleExoPlayer player,
TextView textView) |
| 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 target
TextView. |
protected String |
getPlayerStateString() |
Returns a string containing player state debugging information.
|
protected String |
getVideoString() |
Returns a string containing video debugging information.
|
void |
onPlaybackStateChanged(int playbackState) |
Called when the value returned from
Player.getPlaybackState() changes. |
void |
onPlayWhenReadyChanged(boolean playWhenReady,
int playbackState) |
Called when the value returned from
Player.getPlayWhenReady() changes. |
void |
onPositionDiscontinuity(int reason) |
Called when a position discontinuity occurs without a change to the timeline.
|
void |
run() |
|
void |
start() |
Starts periodic updates of the
TextView. |
void |
stop() |
Stops periodic updates of the
TextView. |
protected void |
updateAndPost() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonEvents, onExperimentalOffloadSchedulingEnabledChanged, onExperimentalSleepingForOffloadChanged, onIsLoadingChanged, onIsPlayingChanged, onLoadingChanged, onMediaItemTransition, onPlaybackParametersChanged, onPlaybackSuppressionReasonChanged, onPlayerError, onPlayerStateChanged, onRepeatModeChanged, onSeekProcessed, onShuffleModeEnabledChanged, onStaticMetadataChanged, onTimelineChanged, onTimelineChanged, onTracksChangedpublic DebugTextViewHelper(SimpleExoPlayer player, TextView textView)
player - The SimpleExoPlayer 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.public final void start()
TextView. Must be called from the application's main
thread.public final void stop()
TextView. Must be called from the application's main
thread.public final void onPlaybackStateChanged(@State int playbackState)
Player.EventListenerPlayer.getPlaybackState() changes.
Player.EventListener.onEvents(Player, Events) will also be called to report this event along with
other events that happen in the same Looper message queue iteration.
onPlaybackStateChanged in interface Player.EventListenerplaybackState - The new playback state.public final void onPlayWhenReadyChanged(boolean playWhenReady,
@PlayWhenReadyChangeReason
int playbackState)
Player.EventListenerPlayer.getPlayWhenReady() changes.
Player.EventListener.onEvents(Player, Events) will also be called to report this event along with
other events that happen in the same Looper message queue iteration.
onPlayWhenReadyChanged in interface Player.EventListenerplayWhenReady - Whether playback will proceed when ready.playbackState - The reason for the change.public final void onPositionDiscontinuity(@DiscontinuityReason int reason)
Player.EventListenerWhen a position discontinuity occurs as a result of a change to the timeline this method
is not called. Player.EventListener.onTimelineChanged(Timeline, int) is called in this case.
Player.EventListener.onEvents(Player, Events) will also be called to report this event along with
other events that happen in the same Looper message queue iteration.
onPositionDiscontinuity in interface Player.EventListenerreason - The Player.DiscontinuityReason responsible for the discontinuity.protected final void updateAndPost()
protected String getDebugString()
TextView.protected String getPlayerStateString()
protected String getVideoString()
protected String getAudioString()