public final class DebugTextViewHelper extends Object implements Runnable, Player.EventListener
TextView with debug information obtained from
a SimpleExoPlayer.| Constructor and Description |
|---|
DebugTextViewHelper(SimpleExoPlayer player,
TextView textView) |
| Modifier and Type | Method and Description |
|---|---|
void |
onLoadingChanged(boolean isLoading)
Called when the player starts or stops loading the source.
|
void |
onPlaybackParametersChanged(PlaybackParameters playbackParameters)
Called when the current playback parameters change.
|
void |
onPlayerError(ExoPlaybackException error)
Called when an error occurs.
|
void |
onPlayerStateChanged(boolean playWhenReady,
int playbackState)
Called when the value returned from either
Player.getPlayWhenReady() or
Player.getPlaybackState() changes. |
void |
onPositionDiscontinuity()
Called when a position discontinuity occurs without a change to the timeline.
|
void |
onRepeatModeChanged(int repeatMode)
Called when the value of
Player.getRepeatMode() changes. |
void |
onTimelineChanged(Timeline timeline,
Object manifest)
Called when the timeline and/or manifest has been refreshed.
|
void |
onTracksChanged(TrackGroupArray tracks,
TrackSelectionArray selections)
Called when the available or selected tracks change.
|
void |
run() |
void |
start()
Starts periodic updates of the
TextView. |
void |
stop()
Stops periodic updates of the
TextView. |
public DebugTextViewHelper(SimpleExoPlayer player, TextView textView)
player - The SimpleExoPlayer from which debug information should be obtained.textView - The TextView that should be updated to display the information.public void start()
TextView. Must be called from the application's main
thread.public void stop()
TextView. Must be called from the application's main
thread.public void onLoadingChanged(boolean isLoading)
Player.EventListeneronLoadingChanged in interface Player.EventListenerisLoading - Whether the source is currently being loaded.public void onPlayerStateChanged(boolean playWhenReady,
int playbackState)
Player.EventListenerPlayer.getPlayWhenReady() or
Player.getPlaybackState() changes.onPlayerStateChanged in interface Player.EventListenerplayWhenReady - Whether playback will proceed when ready.playbackState - One of the STATE constants.public void onRepeatModeChanged(int repeatMode)
Player.EventListenerPlayer.getRepeatMode() changes.onRepeatModeChanged in interface Player.EventListenerrepeatMode - The Player.RepeatMode used for playback.public void onPositionDiscontinuity()
Player.EventListener
When a position discontinuity occurs as a result of a change to the timeline this method is
not called. Player.EventListener.onTimelineChanged(Timeline, Object) is called in this case.
onPositionDiscontinuity in interface Player.EventListenerpublic void onPlaybackParametersChanged(PlaybackParameters playbackParameters)
Player.EventListenerPlayer.setPlaybackParameters(PlaybackParameters), or the player itself may change
them (for example, if audio playback switches to passthrough mode, where speed adjustment is
no longer possible).onPlaybackParametersChanged in interface Player.EventListenerplaybackParameters - The playback parameters.public void onTimelineChanged(Timeline timeline, Object manifest)
Player.EventListener
Note that if the timeline has changed then a position discontinuity may also have occurred.
For example, the current period index may have changed as a result of periods being added or
removed from the timeline. This will not be reported via a separate call to
Player.EventListener.onPositionDiscontinuity().
onTimelineChanged in interface Player.EventListenertimeline - The latest timeline. Never null, but may be empty.manifest - The latest manifest. May be null.public void onPlayerError(ExoPlaybackException error)
Player.EventListenerPlayer.STATE_IDLE
immediately after this method is called. The player instance can still be used, and
Player.release() must still be called on the player should it no longer be required.onPlayerError in interface Player.EventListenererror - The error.public void onTracksChanged(TrackGroupArray tracks, TrackSelectionArray selections)
Player.EventListeneronTracksChanged in interface Player.EventListenertracks - The available tracks. Never null, but may be of length zero.selections - The track selections for each renderer. Never null and always of
length Player.getRendererCount(), but may contain null elements.