public static interface Player.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
Player.getPlayWhenReady() or
Player.getPlaybackState() changes. |
void |
onPositionDiscontinuity(int reason)
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 |
onSeekProcessed()
Called when all pending seek requests have been processed by the player.
|
void |
onShuffleModeEnabledChanged(boolean shuffleModeEnabled)
Called when the value of
Player.getShuffleModeEnabled() changes. |
void |
onTimelineChanged(Timeline timeline,
java.lang.Object manifest,
int reason)
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, @Nullable java.lang.Object manifest, int reason)
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(int).
timeline - The latest timeline. Never null, but may be empty.manifest - The latest manifest. May be null.reason - The Player.TimelineChangeReason responsible for this timeline change.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 Player.getRendererCount(), but may contain null elements.void onLoadingChanged(boolean isLoading)
isLoading - Whether the source is currently being loaded.void onPlayerStateChanged(boolean playWhenReady,
int playbackState)
Player.getPlayWhenReady() or
Player.getPlaybackState() changes.playWhenReady - Whether playback will proceed when ready.playbackState - One of the STATE constants.void onRepeatModeChanged(int repeatMode)
Player.getRepeatMode() changes.repeatMode - The Player.RepeatMode used for playback.void onShuffleModeEnabledChanged(boolean shuffleModeEnabled)
Player.getShuffleModeEnabled() changes.shuffleModeEnabled - Whether shuffling of windows is enabled.void onPlayerError(ExoPlaybackException error)
Player.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.error - The error.void onPositionDiscontinuity(int reason)
When a position discontinuity occurs as a result of a change to the timeline this method is
not called. onTimelineChanged(Timeline, Object, int) is called in this
case.
reason - The Player.DiscontinuityReason responsible for the discontinuity.void onPlaybackParametersChanged(PlaybackParameters playbackParameters)
Player.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.void onSeekProcessed()
onPlayerStateChanged(boolean, int).