public class DebugTextViewHelper
extends java.lang.Object
implements com.google.android.exoplayer2.Player.EventListener, java.lang.Runnable
TextView with debug information obtained from
a SimpleExoPlayer.| Constructor and Description |
|---|
DebugTextViewHelper(com.google.android.exoplayer2.SimpleExoPlayer player,
android.widget.TextView textView) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getAudioString()
Returns a string containing audio debugging information.
|
protected java.lang.String |
getDebugString()
Returns the debugging information string to be shown by the target
TextView. |
protected java.lang.String |
getPlayerStateString()
Returns a string containing player state debugging information.
|
protected java.lang.String |
getVideoString()
Returns a string containing video debugging information.
|
void |
onPlayerStateChanged(boolean playWhenReady,
int playbackState) |
void |
onPositionDiscontinuity(int reason) |
void |
run() |
void |
start()
Starts periodic updates of the
TextView. |
void |
stop()
Stops periodic updates of the
TextView. |
protected void |
updateAndPost() |
public DebugTextViewHelper(com.google.android.exoplayer2.SimpleExoPlayer player,
android.widget.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 onPlayerStateChanged(boolean playWhenReady,
int playbackState)
onPlayerStateChanged in interface com.google.android.exoplayer2.Player.EventListenerpublic final void onPositionDiscontinuity(@Player.DiscontinuityReason
int reason)
onPositionDiscontinuity in interface com.google.android.exoplayer2.Player.EventListenerpublic final void run()
run in interface java.lang.Runnableprotected final void updateAndPost()
protected java.lang.String getDebugString()
TextView.protected java.lang.String getPlayerStateString()
protected java.lang.String getVideoString()
protected java.lang.String getAudioString()