public static interface ExoPlayer.EventListener
| 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
ExoPlayer.getPlayWhenReady() or
ExoPlayer.getPlaybackState() changes. |
void |
onPositionDiscontinuity()
Called when a position discontinuity occurs without a change to the timeline.
|
void |
onTimelineChanged(Timeline timeline,
java.lang.Object manifest)
Called when the timeline and/or manifest has been refreshed.
|
void |
onTracksChanged(TrackGroupArray trackGroups,
TrackSelectionArray trackSelections)
Called when the available or selected tracks change.
|
void onTimelineChanged(Timeline timeline, java.lang.Object manifest)
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
onPositionDiscontinuity().
timeline - The latest timeline. Never null, but may be empty.manifest - The latest manifest. May be null.void onTracksChanged(TrackGroupArray trackGroups, TrackSelectionArray trackSelections)
trackGroups - The available tracks. Never null, but may be of length zero.trackSelections - The track selections for each Renderer. Never null and always
of length ExoPlayer.getRendererCount(), but may contain null elements.void onLoadingChanged(boolean isLoading)
isLoading - Whether the source is currently being loaded.void onPlayerStateChanged(boolean playWhenReady,
int playbackState)
ExoPlayer.getPlayWhenReady() or
ExoPlayer.getPlaybackState() changes.playWhenReady - Whether playback will proceed when ready.playbackState - One of the STATE constants defined in the ExoPlayer
interface.void onPlayerError(ExoPlaybackException error)
ExoPlayer.STATE_IDLE
immediately after this method is called. The player instance can still be used, and
ExoPlayer.release() must still be called on the player should it no longer be required.error - The error.void onPositionDiscontinuity()
When a position discontinuity occurs as a result of a change to the timeline this method is
not called. onTimelineChanged(Timeline, Object) is called in this case.
void onPlaybackParametersChanged(PlaybackParameters playbackParameters)
ExoPlayer.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).playbackParameters - The playback parameters.