docs/doc/reference/com/google/android/exoplayer2/analytics/DefaultAnalyticsCollector.html
Package com.google.android.exoplayer2.analytics
All Implemented Interfaces:AnalyticsCollector, DrmSessionEventListener, Player.Listener, MediaSourceEventListener, BandwidthMeter.EventListener
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classDefaultAnalyticsCollectorextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[AnalyticsCollector](AnalyticsCollector.html "interface in com.google.android.exoplayer2.analytics")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Data collector that forwards analytics events to AnalyticsListeners.
-
BandwidthMeter.EventListener.EventDispatcher
-
DrmSessionEventListener.EventDispatcher
-
MediaSourceEventListener.EventDispatcher
Constructors | Constructor | Description |
| --- | --- |
| DefaultAnalyticsCollector(Clock clock) |
Deprecated.
Creates an analytics collector. |
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| void | addListener(AnalyticsListener listener) |
Deprecated.
Adds a listener for analytics events.
|
| protected AnalyticsListener.EventTime | generateCurrentPlayerMediaPeriodEventTime() |
Deprecated.
Generates an AnalyticsListener.EventTime for the currently playing item in the player.
|
| protected AnalyticsListener.EventTime | generateEventTime(Timeline timeline, int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) |
Deprecated.
Returns a new AnalyticsListener.EventTime for the specified timeline, window and media period id.
|
| void | notifySeekStarted() |
Deprecated.
Notify analytics collector that a seek operation will start.
|
| void | onAudioAttributesChanged(AudioAttributes audioAttributes) |
Deprecated.
Called when the value of Player.getAudioAttributes() changes.
|
| void | onAudioCodecError(Exception audioCodecError) |
Deprecated.
Called when an audio decoder encounters an error.
|
| void | onAudioDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) |
Deprecated.
Called when a audio decoder is created.
|
| void | onAudioDecoderReleased(String decoderName) |
Deprecated.
Called when a audio decoder is released.
|
| void | onAudioDisabled(DecoderCounters counters) |
Deprecated.
Called when the audio renderer is disabled.
|
| void | onAudioEnabled(DecoderCounters counters) |
Deprecated.
Called when the audio renderer is enabled.
|
| void | onAudioInputFormatChanged(Format format, DecoderReuseEvaluation decoderReuseEvaluation) |
Deprecated.
Called when the format of the media being consumed by the audio renderer changes.
|
| void | onAudioPositionAdvancing(long playoutStartSystemTimeMs) |
Deprecated.
Called when the audio position has increased for the first time since the last pause or position reset.
|
| void | onAudioSessionIdChanged(int audioSessionId) |
Deprecated.
Called when the audio session ID changes.
|
| void | onAudioSinkError(Exception audioSinkError) |
Deprecated.
Called when AudioSink has encountered an error.
|
| void | onAudioUnderrun(int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs) |
Deprecated.
Called when an audio underrun occurs.
|
| void | onAvailableCommandsChanged(Player.Commands availableCommands) |
Deprecated.
Called when the value returned from Player.isCommandAvailable(int) changes for at least one Player.Command.
|
| void | onBandwidthSample(int elapsedMs, long bytesTransferred, long bitrateEstimate) |
Deprecated.
Called periodically to indicate that bytes have been transferred or the estimated bitrate has changed.
|
| void | onCues(CueGroup cueGroup) |
Deprecated.
Called when the value of Player.getCurrentCues() changes.
|
| void | onCues(List<Cue> cues) |
Deprecated.
Called when the value of Player.getCurrentCues() changes.
|
| void | onDeviceInfoChanged(DeviceInfo deviceInfo) |
Deprecated.
Called when the device information changes
|
| void | onDeviceVolumeChanged(int volume, boolean muted) |
Deprecated.
Called when the value of Player.getDeviceVolume() or Player.isDeviceMuted() changes.
|
| void | onDownstreamFormatChanged(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData) |
Deprecated.
Called when a downstream format change occurs (i.e.
|
| void | onDrmKeysLoaded(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) |
Deprecated.
Called each time keys are loaded.
|
| void | onDrmKeysRemoved(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) |
Deprecated.
Called each time offline keys are removed.
|
| void | onDrmKeysRestored(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) |
Deprecated.
Called each time offline keys are restored.
|
| void | onDrmSessionAcquired(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, @com.google.android.exoplayer2.drm.DrmSession.State int state) |
Deprecated.
Called each time a drm session is acquired.
|
| void | onDrmSessionManagerError(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, Exception error) |
Deprecated.
Called when a drm error occurs.
|
| void | onDrmSessionReleased(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId) |
Deprecated.
Called each time a drm session is released.
|
| void | onDroppedFrames(int count, long elapsedMs) |
Deprecated.
Called to report the number of frames dropped by the video renderer.
|
| void | onEvents(Player player, Player.Events events) |
Deprecated.
Called when one or more player states changed.
|
| void | onIsLoadingChanged(boolean isLoading) |
Deprecated.
Called when the player starts or stops loading the source.
|
| void | onIsPlayingChanged(boolean isPlaying) |
Deprecated.
Called when the value of Player.isPlaying() changes.
|
| void | onLoadCanceled(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) |
Deprecated.
Called when a load is canceled.
|
| void | onLoadCompleted(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) |
Deprecated.
Called when a load ends.
|
| void | onLoadError(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled) |
Deprecated.
Called when a load error occurs.
|
| void | onLoadingChanged(boolean isLoading) |
Deprecated.
|
| void | onLoadStarted(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData) |
Deprecated.
Called when a load begins.
|
| void | onMaxSeekToPreviousPositionChanged(long maxSeekToPreviousPositionMs) |
Deprecated.
Called when the value of Player.getMaxSeekToPreviousPosition() changes.
|
| void | onMediaItemTransition(MediaItem mediaItem, @com.google.android.exoplayer2.Player.MediaItemTransitionReason int reason) |
Deprecated.
Called when playback transitions to a media item or starts repeating a media item according to the current repeat mode.
|
| void | onMediaMetadataChanged(MediaMetadata mediaMetadata) |
Deprecated.
Called when the value of Player.getMediaMetadata() changes.
|
| void | onMetadata(Metadata metadata) |
Deprecated.
Called when there is metadata associated with the current playback time.
|
| void | onPlaybackParametersChanged(PlaybackParameters playbackParameters) |
Deprecated.
Called when the value of Player.getPlaybackParameters() changes.
|
| void | onPlaybackStateChanged(@com.google.android.exoplayer2.Player.State int playbackState) |
Deprecated.
Called when the value returned from Player.getPlaybackState() changes.
|
| void | onPlaybackSuppressionReasonChanged(@com.google.android.exoplayer2.Player.PlaybackSuppressionReason int playbackSuppressionReason) |
Deprecated.
Called when the value returned from Player.getPlaybackSuppressionReason() changes.
|
| void | onPlayerError(PlaybackException error) |
Deprecated.
Called when an error occurs.
|
| void | onPlayerErrorChanged(PlaybackException error) |
Deprecated.
Called when the PlaybackException returned by Player.getPlayerError() changes.
|
| void | onPlayerStateChanged(boolean playWhenReady, @com.google.android.exoplayer2.Player.State int playbackState) |
Deprecated.
|
| void | onPlaylistMetadataChanged(MediaMetadata playlistMetadata) |
Deprecated.
Called when the value of Player.getPlaylistMetadata() changes.
|
| void | onPlayWhenReadyChanged(boolean playWhenReady, @com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int reason) |
Deprecated.
Called when the value returned from Player.getPlayWhenReady() changes.
|
| void | onPositionDiscontinuity(@com.google.android.exoplayer2.Player.DiscontinuityReason int reason) |
Deprecated.
|
| void | onPositionDiscontinuity(Player.PositionInfo oldPosition, Player.PositionInfo newPosition, @com.google.android.exoplayer2.Player.DiscontinuityReason int reason) |
Deprecated.
Called when a position discontinuity occurs.
|
| void | onRenderedFirstFrame() |
Deprecated.
Called when a frame is rendered for the first time since setting the surface, or since the renderer was reset, or since the stream being rendered was changed.
|
| void | onRenderedFirstFrame(Object output, long renderTimeMs) |
Deprecated.
Called when a frame is rendered for the first time since setting the output, or since the renderer was reset, or since the stream being rendered was changed.
|
| void | onRepeatModeChanged(@com.google.android.exoplayer2.Player.RepeatMode int repeatMode) |
Deprecated.
Called when the value of Player.getRepeatMode() changes.
|
| void | onSeekBackIncrementChanged(long seekBackIncrementMs) |
Deprecated.
Called when the value of Player.getSeekBackIncrement() changes.
|
| void | onSeekForwardIncrementChanged(long seekForwardIncrementMs) |
Deprecated.
Called when the value of Player.getSeekForwardIncrement() changes.
|
| void | onShuffleModeEnabledChanged(boolean shuffleModeEnabled) |
Deprecated.
Called when the value of Player.getShuffleModeEnabled() changes.
|
| void | onSkipSilenceEnabledChanged(boolean skipSilenceEnabled) |
Deprecated.
Called when skipping silences is enabled or disabled in the audio stream.
|
| void | onSurfaceSizeChanged(int width, int height) |
Deprecated.
Called each time there's a change in the size of the surface onto which the video is being rendered.
|
| void | onTimelineChanged(Timeline timeline, @com.google.android.exoplayer2.Player.TimelineChangeReason int reason) |
Deprecated.
Called when the value of Player.getCurrentTimeline() changes.
|
| void | onTracksChanged(Tracks tracks) |
Deprecated.
Called when the value of Player.getCurrentTracks() changes.
|
| void | onTrackSelectionParametersChanged(TrackSelectionParameters parameters) |
Deprecated.
Called when the value returned from Player.getTrackSelectionParameters() changes.
|
| void | onUpstreamDiscarded(int windowIndex, MediaSource.MediaPeriodId mediaPeriodId, MediaLoadData mediaLoadData) |
Deprecated.
Called when data is removed from the back of a media buffer, typically so that it can be re-buffered in a different format.
|
| void | onVideoCodecError(Exception videoCodecError) |
Deprecated.
Called when a video decoder encounters an error.
|
| void | onVideoDecoderInitialized(String decoderName, long initializedTimestampMs, long initializationDurationMs) |
Deprecated.
Called when a video decoder is created.
|
| void | onVideoDecoderReleased(String decoderName) |
Deprecated.
Called when a video decoder is released.
|
| void | onVideoDisabled(DecoderCounters counters) |
Deprecated.
Called when the video renderer is disabled.
|
| void | onVideoEnabled(DecoderCounters counters) |
Deprecated.
Called when the video renderer is enabled.
|
| void | onVideoFrameProcessingOffset(long totalProcessingOffsetUs, int frameCount) |
Deprecated.
Called to report the video processing offset of video frames processed by the video renderer.
|
| void | onVideoInputFormatChanged(Format format, DecoderReuseEvaluation decoderReuseEvaluation) |
Deprecated.
Called when the format of the media being consumed by the video renderer changes.
|
| void | onVideoSizeChanged(VideoSize videoSize) |
Deprecated.
Called each time when Player.getVideoSize() changes.
|
| void | onVolumeChanged(float volume) |
Deprecated.
Called when the value of Player.getVolume() changes.
|
| void | release() |
Deprecated.
Releases the collector.
|
| void | removeListener(AnalyticsListener listener) |
Deprecated.
Removes a previously added analytics event listener.
|
| protected void | sendEvent(AnalyticsListener.EventTime eventTime, int eventFlag, ListenerSet.Event<AnalyticsListener> eventInvocation) |
Deprecated.
Sends an event to registered listeners.
|
| void | setPlayer(Player player, Looper looper) |
Deprecated.
Sets the player for which data will be collected.
|
| void | setThrowsWhenUsingWrongThread(boolean throwsWhenUsingWrongThread) |
Deprecated.
Do not use this method and ensure all calls are made from the correct thread.
|
| void | updateMediaPeriodQueueInfo(List<MediaSource.MediaPeriodId> queue, MediaSource.MediaPeriodId readingPeriod) |
Deprecated.
Updates the playback queue information used for event association. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
onDrmSessionAcquired
-
public DefaultAnalyticsCollector([Clock](../util/Clock.html "interface in com.google.android.exoplayer2.util")clock)
Deprecated.
Creates an analytics collector.
Parameters:clock - A Clock used to generate timestamps.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public void setThrowsWhenUsingWrongThread(boolean throwsWhenUsingWrongThread)
Deprecated. Do not use this method and ensure all calls are made from the correct thread.
Sets whether methods throw when using the wrong thread.
Do not use this method unless to support legacy use cases.
Parameters:throwsWhenUsingWrongThread - Whether to throw when using the wrong thread.
-
@CallSuper
public void addListener([AnalyticsListener](AnalyticsListener.html "interface in com.google.android.exoplayer2.analytics")listener)
Deprecated.
Description copied from interface: AnalyticsCollector
Adds a listener for analytics events.
Specified by:addListener in interface AnalyticsCollectorParameters:listener - The listener to add.
-
@CallSuper
public void removeListener([AnalyticsListener](AnalyticsListener.html "interface in com.google.android.exoplayer2.analytics")listener)
Deprecated.
Description copied from interface: AnalyticsCollector
Removes a previously added analytics event listener.
Specified by:removeListener in interface AnalyticsCollectorParameters:listener - The listener to remove.
-
@CallSuper
public void setPlayer([Player](../Player.html "interface in com.google.android.exoplayer2")player,[Looper](https://developer.android.com/reference/android/os/Looper.html "class or interface in android.os")looper)
Deprecated.
Description copied from interface: AnalyticsCollector
Sets the player for which data will be collected. Must only be called if no player has been set yet or the current player is idle.
Specified by:setPlayer in interface AnalyticsCollectorParameters:player - The Player for which data will be collected.looper - The Looper used for listener callbacks.
-
@CallSuper
public void release()
Deprecated.
Description copied from interface: AnalyticsCollector
Releases the collector. Must be called after the player for which data is collected has been released.
Specified by:release in interface AnalyticsCollector
-
public final void updateMediaPeriodQueueInfo([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")> queue,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")readingPeriod)
Deprecated.
Description copied from interface: AnalyticsCollector
Updates the playback queue information used for event association.
Should only be called by the player controlling the queue and not from app code.
Specified by:updateMediaPeriodQueueInfo in interface AnalyticsCollectorParameters:queue - The playback queue of media periods identified by their MediaSource.MediaPeriodId.readingPeriod - The media period in the queue that is currently being read by renderers, or null if the queue is empty.
-
public final void notifySeekStarted()
Deprecated.
Description copied from interface: AnalyticsCollector
Notify analytics collector that a seek operation will start. Should be called before the player adjusts its state and position to the seek.
Specified by:notifySeekStarted in interface AnalyticsCollector
-
public final void onAudioEnabled([DecoderCounters](../decoder/DecoderCounters.html "class in com.google.android.exoplayer2.decoder")counters)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when the audio renderer is enabled.
Specified by:onAudioEnabled in interface AnalyticsCollectorParameters:counters - DecoderCounters that will be updated by the audio renderer for as long as it remains enabled.
-
public final void onAudioDecoderInitialized([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")decoderName,
long initializedTimestampMs,
long initializationDurationMs)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when a audio decoder is created.
Specified by:onAudioDecoderInitialized in interface AnalyticsCollectorParameters:decoderName - The audio decoder that was created.initializedTimestampMs - SystemClock.elapsedRealtime() when initialization finished.initializationDurationMs - The time taken to initialize the decoder in milliseconds.
-
public final void onAudioInputFormatChanged([Format](../Format.html "class in com.google.android.exoplayer2")format,
@Nullable[DecoderReuseEvaluation](../decoder/DecoderReuseEvaluation.html "class in com.google.android.exoplayer2.decoder")decoderReuseEvaluation)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when the format of the media being consumed by the audio renderer changes.
Specified by:onAudioInputFormatChanged in interface AnalyticsCollectorParameters:format - The new format.decoderReuseEvaluation - The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, or null if the renderer did not have a decoder.
-
public final void onAudioPositionAdvancing(long playoutStartSystemTimeMs)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when the audio position has increased for the first time since the last pause or position reset.
Specified by:onAudioPositionAdvancing in interface AnalyticsCollectorParameters:playoutStartSystemTimeMs - The approximate derived System.currentTimeMillis() at which playout started.
-
public final void onAudioUnderrun(int bufferSize,
long bufferSizeMs,
long elapsedSinceLastFeedMs)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when an audio underrun occurs.
Specified by:onAudioUnderrun in interface AnalyticsCollectorParameters:bufferSize - The size of the audio output buffer, in bytes.bufferSizeMs - The size of the audio output buffer, in milliseconds, if it contains PCM encoded audio. C.TIME_UNSET if the output buffer contains non-PCM encoded audio.elapsedSinceLastFeedMs - The time since audio was last written to the output buffer.
-
public final void onAudioDecoderReleased([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")decoderName)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when a audio decoder is released.
Specified by:onAudioDecoderReleased in interface AnalyticsCollectorParameters:decoderName - The audio decoder that was released.
-
public final void onAudioDisabled([DecoderCounters](../decoder/DecoderCounters.html "class in com.google.android.exoplayer2.decoder")counters)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when the audio renderer is disabled.
Specified by:onAudioDisabled in interface AnalyticsCollectorParameters:counters - DecoderCounters that were updated by the audio renderer.
-
public final void onAudioSinkError([Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")audioSinkError)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when AudioSink has encountered an error.
If the sink writes to a platform AudioTrack, this will be called for all AudioTrack errors.
Specified by:onAudioSinkError in interface AnalyticsCollectorParameters:audioSinkError - The error that occurred. Typically an AudioSink.InitializationException, a AudioSink.WriteException, or an AudioSink.UnexpectedDiscontinuityException.
-
public final void onAudioCodecError([Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")audioCodecError)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when an audio decoder encounters an error.
Specified by:onAudioCodecError in interface AnalyticsCollectorParameters:audioCodecError - The error. Typically a MediaCodec.CodecException if the renderer uses MediaCodec, or a DecoderException if the renderer uses a software decoder.
-
public final void onVolumeChanged(float volume)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getVolume() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onVolumeChanged in interface Player.ListenerParameters:volume - The new volume, with 0 being silence and 1 being unity gain.
-
public final void onVideoEnabled([DecoderCounters](../decoder/DecoderCounters.html "class in com.google.android.exoplayer2.decoder")counters)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when the video renderer is enabled.
Specified by:onVideoEnabled in interface AnalyticsCollectorParameters:counters - DecoderCounters that will be updated by the video renderer for as long as it remains enabled.
-
public final void onVideoDecoderInitialized([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")decoderName,
long initializedTimestampMs,
long initializationDurationMs)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when a video decoder is created.
Specified by:onVideoDecoderInitialized in interface AnalyticsCollectorParameters:decoderName - The decoder that was created.initializedTimestampMs - SystemClock.elapsedRealtime() when initialization finished.initializationDurationMs - The time taken to initialize the decoder in milliseconds.
-
public final void onVideoInputFormatChanged([Format](../Format.html "class in com.google.android.exoplayer2")format,
@Nullable[DecoderReuseEvaluation](../decoder/DecoderReuseEvaluation.html "class in com.google.android.exoplayer2.decoder")decoderReuseEvaluation)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when the format of the media being consumed by the video renderer changes.
Specified by:onVideoInputFormatChanged in interface AnalyticsCollectorParameters:format - The new format.decoderReuseEvaluation - The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, or null if the renderer did not have a decoder.
-
public final void onDroppedFrames(int count,
long elapsedMs)
Deprecated.
Description copied from interface: AnalyticsCollector
Called to report the number of frames dropped by the video renderer. Dropped frames are reported whenever the renderer is stopped having dropped frames, and optionally, whenever the count reaches a specified threshold whilst the renderer is started.
Specified by:onDroppedFrames in interface AnalyticsCollectorParameters:count - The number of dropped frames.elapsedMs - The duration in milliseconds over which the frames were dropped. This duration is timed from when the renderer was started or from when dropped frames were last reported (whichever was more recent), and not from when the first of the reported drops occurred.
-
public final void onVideoDecoderReleased([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")decoderName)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when a video decoder is released.
Specified by:onVideoDecoderReleased in interface AnalyticsCollectorParameters:decoderName - The video decoder that was released.
-
public final void onVideoDisabled([DecoderCounters](../decoder/DecoderCounters.html "class in com.google.android.exoplayer2.decoder")counters)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when the video renderer is disabled.
Specified by:onVideoDisabled in interface AnalyticsCollectorParameters:counters - DecoderCounters that were updated by the video renderer.
-
public final void onRenderedFirstFrame([Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")output,
long renderTimeMs)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when a frame is rendered for the first time since setting the output, or since the renderer was reset, or since the stream being rendered was changed.
Specified by:onRenderedFirstFrame in interface AnalyticsCollectorParameters:output - The output of the video renderer. Normally a Surface, however some video renderers may have other output types (e.g., a VideoDecoderOutputBufferRenderer).renderTimeMs - The SystemClock.elapsedRealtime() when the frame was rendered.
-
public final void onVideoFrameProcessingOffset(long totalProcessingOffsetUs,
int frameCount)
Deprecated.
Description copied from interface: AnalyticsCollector
Called to report the video processing offset of video frames processed by the video renderer.
Video processing offset represents how early a video frame is processed compared to the player's current position. For each video frame, the offset is calculated as Pvf - Ppl where Pvf is the presentation timestamp of the video frame and Ppl is the current position of the player. Positive values indicate the frame was processed early enough whereas negative values indicate that the player's position had progressed beyond the frame's timestamp when the frame was processed (and the frame was probably dropped).
The renderer reports the sum of video processing offset samples (one sample per processed video frame: dropped, skipped or rendered) and the total number of samples.
Specified by:onVideoFrameProcessingOffset in interface AnalyticsCollectorParameters:totalProcessingOffsetUs - The sum of all video frame processing offset samples for the video frames processed by the renderer in microseconds.frameCount - The number of samples included in the totalProcessingOffsetUs.
-
public final void onVideoCodecError([Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")videoCodecError)
Deprecated.
Description copied from interface: AnalyticsCollector
Called when a video decoder encounters an error.
This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry. Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException) is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.
Specified by:onVideoCodecError in interface AnalyticsCollectorParameters:videoCodecError - The error. Typically a MediaCodec.CodecException if the renderer uses MediaCodec, or a DecoderException if the renderer uses a software decoder.
-
public final void onSurfaceSizeChanged(int width,
int height)
Deprecated.
Description copied from interface: Player.Listener
Called each time there's a change in the size of the surface onto which the video is being rendered.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onSurfaceSizeChanged in interface Player.ListenerParameters:width - The surface width in pixels. May be C.LENGTH_UNSET if unknown, or 0 if the video is not rendered onto a surface.height - The surface height in pixels. May be C.LENGTH_UNSET if unknown, or 0 if the video is not rendered onto a surface.
-
public final void onLoadStarted(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[LoadEventInfo](../source/LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,[MediaLoadData](../source/MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Deprecated.
Description copied from interface: MediaSourceEventListener
Called when a load begins.
Specified by:onLoadStarted in interface MediaSourceEventListenerParameters:windowIndex - The window index in the timeline of the media source this load belongs to.mediaPeriodId - The MediaSource.MediaPeriodId this load belongs to. Null if the load does not belong to a specific media period.loadEventInfo - The LoadEventInfo corresponding to the event. The value of LoadEventInfo.uri won't reflect potential redirection yet and LoadEventInfo.responseHeaders will be empty.mediaLoadData - The MediaLoadData defining the data being loaded.
-
public final void onLoadCompleted(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[LoadEventInfo](../source/LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,[MediaLoadData](../source/MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Deprecated.
Description copied from interface: MediaSourceEventListener
Called when a load ends.
Specified by:onLoadCompleted in interface MediaSourceEventListenerParameters:windowIndex - The window index in the timeline of the media source this load belongs to.mediaPeriodId - The MediaSource.MediaPeriodId this load belongs to. Null if the load does not belong to a specific media period.loadEventInfo - The LoadEventInfo corresponding to the event. The values of LoadEventInfo.elapsedRealtimeMs and LoadEventInfo.bytesLoaded are relative to the corresponding MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData) event.mediaLoadData - The MediaLoadData defining the data being loaded.
-
public final void onLoadCanceled(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[LoadEventInfo](../source/LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,[MediaLoadData](../source/MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Deprecated.
Description copied from interface: MediaSourceEventListener
Called when a load is canceled.
Specified by:onLoadCanceled in interface MediaSourceEventListenerParameters:windowIndex - The window index in the timeline of the media source this load belongs to.mediaPeriodId - The MediaSource.MediaPeriodId this load belongs to. Null if the load does not belong to a specific media period.loadEventInfo - The LoadEventInfo corresponding to the event. The values of LoadEventInfo.elapsedRealtimeMs and LoadEventInfo.bytesLoaded are relative to the corresponding MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData) event.mediaLoadData - The MediaLoadData defining the data being loaded.
-
public final void onLoadError(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[LoadEventInfo](../source/LoadEventInfo.html "class in com.google.android.exoplayer2.source")loadEventInfo,[MediaLoadData](../source/MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData,[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")error,
boolean wasCanceled)
Deprecated.
Description copied from interface: MediaSourceEventListener
Called when a load error occurs.
The error may or may not have resulted in the load being canceled, as indicated by the wasCanceled parameter. If the load was canceled, MediaSourceEventListener.onLoadCanceled(int, com.google.android.exoplayer2.source.MediaSource.MediaPeriodId, com.google.android.exoplayer2.source.LoadEventInfo, com.google.android.exoplayer2.source.MediaLoadData) will not be called in addition to this method.
This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry. Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException) is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.
Specified by:onLoadError in interface MediaSourceEventListenerParameters:windowIndex - The window index in the timeline of the media source this load belongs to.mediaPeriodId - The MediaSource.MediaPeriodId this load belongs to. Null if the load does not belong to a specific media period.loadEventInfo - The LoadEventInfo corresponding to the event. The values of LoadEventInfo.elapsedRealtimeMs and LoadEventInfo.bytesLoaded are relative to the corresponding MediaSourceEventListener.onLoadStarted(int, MediaPeriodId, LoadEventInfo, MediaLoadData) event.mediaLoadData - The MediaLoadData defining the data being loaded.error - The load error.wasCanceled - Whether the load was canceled as a result of the error.
-
public final void onUpstreamDiscarded(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[MediaLoadData](../source/MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Deprecated.
Description copied from interface: MediaSourceEventListener
Called when data is removed from the back of a media buffer, typically so that it can be re-buffered in a different format.
Specified by:onUpstreamDiscarded in interface MediaSourceEventListenerParameters:windowIndex - The window index in the timeline of the media source this load belongs to.mediaPeriodId - The MediaSource.MediaPeriodId the media belongs to.mediaLoadData - The MediaLoadData defining the media being discarded.
-
public final void onDownstreamFormatChanged(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[MediaLoadData](../source/MediaLoadData.html "class in com.google.android.exoplayer2.source")mediaLoadData)
Deprecated.
Description copied from interface: MediaSourceEventListener
Called when a downstream format change occurs (i.e. when the format of the media being read from one or more SampleStreams provided by the source changes).
Specified by:onDownstreamFormatChanged in interface MediaSourceEventListenerParameters:windowIndex - The window index in the timeline of the media source this load belongs to.mediaPeriodId - The MediaSource.MediaPeriodId the media belongs to.mediaLoadData - The MediaLoadData defining the newly selected downstream data.
-
public final void onTimelineChanged([Timeline](../Timeline.html "class in com.google.android.exoplayer2")timeline,[@TimelineChangeReason](../Player.TimelineChangeReason.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.TimelineChangeReason int reason)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getCurrentTimeline() changes.
Note that the current MediaItem or playback position may change as a result of a timeline change. If playback can't continue smoothly because of this timeline change, a separate Player.Listener.onPositionDiscontinuity(PositionInfo, PositionInfo, int) callback will be triggered.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onTimelineChanged in interface Player.ListenerParameters:timeline - The latest timeline. Never null, but may be empty.reason - The Player.TimelineChangeReason responsible for this timeline change.
-
public final void onMediaItemTransition(@Nullable[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem,[@MediaItemTransitionReason](../Player.MediaItemTransitionReason.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.MediaItemTransitionReason int reason)
Deprecated.
Description copied from interface: Player.Listener
Called when playback transitions to a media item or starts repeating a media item according to the current repeat mode.
Note that this callback is also called when the value of Player.getCurrentTimeline() becomes non-empty or empty.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onMediaItemTransition in interface Player.ListenerParameters:mediaItem - The MediaItem. May be null if the playlist becomes empty.reason - The reason for the transition.
-
public void onTracksChanged([Tracks](../Tracks.html "class in com.google.android.exoplayer2")tracks)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getCurrentTracks() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onTracksChanged in interface Player.ListenerParameters:tracks - The available tracks information. Never null, but may be of length zero.
-
public void onLoadingChanged(boolean isLoading)
Deprecated.
Specified by:onLoadingChanged in interface Player.Listener
-
public final void onIsLoadingChanged(boolean isLoading)
Deprecated.
Description copied from interface: Player.Listener
Called when the player starts or stops loading the source.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onIsLoadingChanged in interface Player.ListenerParameters:isLoading - Whether the source is currently being loaded.
-
public void onAvailableCommandsChanged([Player.Commands](../Player.Commands.html "class in com.google.android.exoplayer2")availableCommands)
Deprecated.
Description copied from interface: Player.Listener
Called when the value returned from Player.isCommandAvailable(int) changes for at least one Player.Command.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onAvailableCommandsChanged in interface Player.ListenerParameters:availableCommands - The available Player.Commands.
-
public final void onPlayerStateChanged(boolean playWhenReady,[@State](../Player.State.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.State int playbackState)
Deprecated.
Specified by:onPlayerStateChanged in interface Player.Listener
-
public final void onPlaybackStateChanged([@State](../Player.State.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.State int playbackState)
Deprecated.
Description copied from interface: Player.Listener
Called when the value returned from Player.getPlaybackState() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onPlaybackStateChanged in interface Player.ListenerParameters:playbackState - The new playback Player.State.
-
public final void onPlayWhenReadyChanged(boolean playWhenReady,[@PlayWhenReadyChangeReason](../Player.PlayWhenReadyChangeReason.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int reason)
Deprecated.
Description copied from interface: Player.Listener
Called when the value returned from Player.getPlayWhenReady() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onPlayWhenReadyChanged in interface Player.ListenerParameters:playWhenReady - Whether playback will proceed when ready.reason - The Player.PlayWhenReadyChangeReason for the change.
-
public final void onPlaybackSuppressionReasonChanged([@PlaybackSuppressionReason](../Player.PlaybackSuppressionReason.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.PlaybackSuppressionReason int playbackSuppressionReason)
Deprecated.
Description copied from interface: Player.Listener
Called when the value returned from Player.getPlaybackSuppressionReason() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onPlaybackSuppressionReasonChanged in interface Player.ListenerParameters:playbackSuppressionReason - The current Player.PlaybackSuppressionReason.
-
public void onIsPlayingChanged(boolean isPlaying)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.isPlaying() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onIsPlayingChanged in interface Player.ListenerParameters:isPlaying - Whether the player is playing.
-
public final void onRepeatModeChanged([@RepeatMode](../Player.RepeatMode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.RepeatMode int repeatMode)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getRepeatMode() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onRepeatModeChanged in interface Player.ListenerParameters:repeatMode - The Player.RepeatMode used for playback.
-
public final void onShuffleModeEnabledChanged(boolean shuffleModeEnabled)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getShuffleModeEnabled() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onShuffleModeEnabledChanged in interface Player.ListenerParameters:shuffleModeEnabled - Whether shuffling of media items is enabled.
-
public final void onPlayerError([PlaybackException](../PlaybackException.html "class in com.google.android.exoplayer2")error)
Deprecated.
Description copied from interface: Player.Listener
Called when an error occurs. The playback state will transition to 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.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Implementations of Player may pass an instance of a subclass of PlaybackException to this method in order to include more information about the error.
Specified by:onPlayerError in interface Player.ListenerParameters:error - The error.
-
public void onPlayerErrorChanged(@Nullable[PlaybackException](../PlaybackException.html "class in com.google.android.exoplayer2")error)
Deprecated.
Description copied from interface: Player.Listener
Called when the PlaybackException returned by Player.getPlayerError() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Implementations of Player may pass an instance of a subclass of PlaybackException to this method in order to include more information about the error.
Specified by:onPlayerErrorChanged in interface Player.ListenerParameters:error - The new error, or null if the error is being cleared.
-
public void onPositionDiscontinuity([@DiscontinuityReason](../Player.DiscontinuityReason.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.DiscontinuityReason int reason)
Deprecated.
Specified by:onPositionDiscontinuity in interface Player.Listener
-
public final void onPositionDiscontinuity([Player.PositionInfo](../Player.PositionInfo.html "class in com.google.android.exoplayer2")oldPosition,[Player.PositionInfo](../Player.PositionInfo.html "class in com.google.android.exoplayer2")newPosition,[@DiscontinuityReason](../Player.DiscontinuityReason.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.Player.DiscontinuityReason int reason)
Deprecated.
Description copied from interface: Player.Listener
Called when a position discontinuity occurs.
A position discontinuity occurs when the playing period changes, the playback position jumps within the period currently being played, or when the playing period has been skipped or removed.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onPositionDiscontinuity in interface Player.ListenerParameters:oldPosition - The position before the discontinuity.newPosition - The position after the discontinuity.reason - The Player.DiscontinuityReason responsible for the discontinuity.
-
public final void onPlaybackParametersChanged([PlaybackParameters](../PlaybackParameters.html "class in com.google.android.exoplayer2")playbackParameters)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getPlaybackParameters() changes. The playback parameters may change due to a call to Player.setPlaybackParameters(PlaybackParameters), or the player itself may change them (for example, if audio playback switches to passthrough or offload mode, where speed adjustment is no longer possible).
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onPlaybackParametersChanged in interface Player.ListenerParameters:playbackParameters - The playback parameters.
-
public void onSeekBackIncrementChanged(long seekBackIncrementMs)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getSeekBackIncrement() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onSeekBackIncrementChanged in interface Player.ListenerParameters:seekBackIncrementMs - The Player.seekBack() increment, in milliseconds.
-
public void onSeekForwardIncrementChanged(long seekForwardIncrementMs)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getSeekForwardIncrement() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onSeekForwardIncrementChanged in interface Player.ListenerParameters:seekForwardIncrementMs - The Player.seekForward() increment, in milliseconds.
-
public void onMaxSeekToPreviousPositionChanged(long maxSeekToPreviousPositionMs)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getMaxSeekToPreviousPosition() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onMaxSeekToPreviousPositionChanged in interface Player.ListenerParameters:maxSeekToPreviousPositionMs - The maximum position for which Player.seekToPrevious() seeks to the previous position, in milliseconds.
-
public void onMediaMetadataChanged([MediaMetadata](../MediaMetadata.html "class in com.google.android.exoplayer2")mediaMetadata)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getMediaMetadata() changes.
This method may be called multiple times in quick succession.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onMediaMetadataChanged in interface Player.ListenerParameters:mediaMetadata - The combined MediaMetadata.
-
public void onPlaylistMetadataChanged([MediaMetadata](../MediaMetadata.html "class in com.google.android.exoplayer2")playlistMetadata)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getPlaylistMetadata() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onPlaylistMetadataChanged in interface Player.Listener
-
public final void onMetadata([Metadata](../metadata/Metadata.html "class in com.google.android.exoplayer2.metadata")metadata)
Deprecated.
Description copied from interface: Player.Listener
Called when there is metadata associated with the current playback time.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onMetadata in interface Player.ListenerParameters:metadata - The metadata.
-
public void onCues([List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Cue](../text/Cue.html "class in com.google.android.exoplayer2.text")> cues)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getCurrentCues() changes.
Both this method and Player.Listener.onCues(CueGroup) are called when there is a change in the cues. You should only implement one or the other.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onCues in interface Player.Listener
-
public void onCues([CueGroup](../text/CueGroup.html "class in com.google.android.exoplayer2.text")cueGroup)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getCurrentCues() changes.
Both this method and Player.Listener.onCues(List) are called when there is a change in the cues. You should only implement one or the other.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onCues in interface Player.Listener
-
public final void onSkipSilenceEnabledChanged(boolean skipSilenceEnabled)
Deprecated.
Description copied from interface: Player.Listener
Called when skipping silences is enabled or disabled in the audio stream.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onSkipSilenceEnabledChanged in interface Player.ListenerParameters:skipSilenceEnabled - Whether skipping silences in the audio stream is enabled.
-
public final void onAudioSessionIdChanged(int audioSessionId)
Deprecated.
Description copied from interface: Player.Listener
Called when the audio session ID changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onAudioSessionIdChanged in interface Player.ListenerParameters:audioSessionId - The audio session ID.
-
public final void onAudioAttributesChanged([AudioAttributes](../audio/AudioAttributes.html "class in com.google.android.exoplayer2.audio")audioAttributes)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getAudioAttributes() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onAudioAttributesChanged in interface Player.ListenerParameters:audioAttributes - The audio attributes.
-
public final void onVideoSizeChanged([VideoSize](../video/VideoSize.html "class in com.google.android.exoplayer2.video")videoSize)
Deprecated.
Description copied from interface: Player.Listener
Called each time when Player.getVideoSize() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onVideoSizeChanged in interface Player.ListenerParameters:videoSize - The new size of the video.
-
public void onTrackSelectionParametersChanged([TrackSelectionParameters](../trackselection/TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")parameters)
Deprecated.
Description copied from interface: Player.Listener
Called when the value returned from Player.getTrackSelectionParameters() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onTrackSelectionParametersChanged in interface Player.ListenerParameters:parameters - The new TrackSelectionParameters.
-
public void onDeviceInfoChanged([DeviceInfo](../DeviceInfo.html "class in com.google.android.exoplayer2")deviceInfo)
Deprecated.
Description copied from interface: Player.Listener
Called when the device information changes
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onDeviceInfoChanged in interface Player.ListenerParameters:deviceInfo - The new DeviceInfo.
-
public void onDeviceVolumeChanged(int volume,
boolean muted)
Deprecated.
Description copied from interface: Player.Listener
Called when the value of Player.getDeviceVolume() or Player.isDeviceMuted() changes.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onDeviceVolumeChanged in interface Player.ListenerParameters:volume - The new device volume, with 0 being silence and 1 being unity gain.muted - Whether the device is muted.
-
public void onRenderedFirstFrame()
Deprecated.
Description copied from interface: Player.Listener
Called when a frame is rendered for the first time since setting the surface, or since the renderer was reset, or since the stream being rendered was changed.
Player.Listener.onEvents(Player, Events) will also be called to report this event along with other events that happen in the same Looper message queue iteration.
Specified by:onRenderedFirstFrame in interface Player.Listener
-
public void onEvents([Player](../Player.html "interface in com.google.android.exoplayer2")player,[Player.Events](../Player.Events.html "class in com.google.android.exoplayer2")events)
Deprecated.
Description copied from interface: Player.Listener
Called when one or more player states changed.
State changes and events that happen within one Looper message queue iteration are reported together and only after all individual callbacks were triggered.
Listeners should prefer this method over individual callbacks in the following cases:
- They intend to trigger the same logic for multiple events (e.g. when updating a UI for both [`Player.Listener.onPlaybackStateChanged(int)`](../Player.Listener.html#onPlaybackStateChanged(@com.google.android.exoplayer2.Player.Stateint)) and [`Player.Listener.onPlayWhenReadyChanged(boolean,
int)`](../Player.Listener.html#onPlayWhenReadyChanged(boolean,@com.google.android.exoplayer2.Player.PlayWhenReadyChangeReasonint))).
- They need access to the [`Player`](../Player.html "interface in com.google.android.exoplayer2") object to trigger further events (e.g. to call [`Player.seekTo(long)`](../Player.html#seekTo(long)) after a [`Player.Listener.onMediaItemTransition(MediaItem, int)`](../Player.Listener.html#onMediaItemTransition(com.google.android.exoplayer2.MediaItem,@com.google.android.exoplayer2.Player.MediaItemTransitionReasonint))).
- They intend to use multiple state values together or in combination with [`Player`](../Player.html "interface in com.google.android.exoplayer2") getter methods. For example using [`Player.getCurrentMediaItemIndex()`](../Player.html#getCurrentMediaItemIndex()) with the `
timeline` provided in [`Player.Listener.onTimelineChanged(Timeline, int)`](../Player.Listener.html#onTimelineChanged(com.google.android.exoplayer2.Timeline,@com.google.android.exoplayer2.Player.TimelineChangeReasonint)) is only safe from within this method.
- They are interested in events that logically happened together (e.g [`Player.Listener.onPlaybackStateChanged(int)`](../Player.Listener.html#onPlaybackStateChanged(@com.google.android.exoplayer2.Player.Stateint)) to [`Player.STATE_BUFFERING`](../Player.html#STATE_BUFFERING) because of [`Player.Listener.onMediaItemTransition(MediaItem, int)`](../Player.Listener.html#onMediaItemTransition(com.google.android.exoplayer2.MediaItem,@com.google.android.exoplayer2.Player.MediaItemTransitionReasonint))).
Specified by:onEvents in interface Player.ListenerParameters:player - The Player whose state changed. Use the getters to obtain the latest states.events - The Player.Events that happened in this iteration, indicating which player states changed.
-
public final void onBandwidthSample(int elapsedMs,
long bytesTransferred,
long bitrateEstimate)
Deprecated.
Description copied from interface: BandwidthMeter.EventListener
Called periodically to indicate that bytes have been transferred or the estimated bitrate has changed.
Note: The estimated bitrate is typically derived from more information than just bytesTransferred and elapsedMs.
Specified by:onBandwidthSample in interface BandwidthMeter.EventListenerParameters:elapsedMs - The time taken to transfer bytesTransferred, in milliseconds. This is at most the elapsed time since the last callback, but may be less if there were periods during which data was not being transferred.bytesTransferred - The number of bytes transferred since the last callback.bitrateEstimate - The estimated bitrate in bits/sec.
-
public final void onDrmSessionAcquired(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[@State](../drm/DrmSession.State.html "annotation in com.google.android.exoplayer2.drm")@com.google.android.exoplayer2.drm.DrmSession.State int state)
Deprecated.
Description copied from interface: DrmSessionEventListener
Called each time a drm session is acquired.
Specified by:onDrmSessionAcquired in interface DrmSessionEventListenerParameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.state - The DrmSession.State of the session when the acquisition completed.
-
public final void onDrmKeysLoaded(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)
Deprecated.
Description copied from interface: DrmSessionEventListener
Called each time keys are loaded.
Specified by:onDrmKeysLoaded in interface DrmSessionEventListenerParameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.
-
public final void onDrmSessionManagerError(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId,[Exception](https://developer.android.com/reference/java/lang/Exception.html "class or interface in java.lang")error)
Deprecated.
Description copied from interface: DrmSessionEventListener
Called when a drm error occurs.
This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error and continue. Hence applications should not implement this method to display a user visible error or initiate an application level retry (Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException) is the appropriate place to implement such behavior). This method is called to provide the application with an opportunity to log the error if it wishes to do so.
Specified by:onDrmSessionManagerError in interface DrmSessionEventListenerParameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.error - The corresponding exception.
-
public final void onDrmKeysRestored(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)
Deprecated.
Description copied from interface: DrmSessionEventListener
Called each time offline keys are restored.
Specified by:onDrmKeysRestored in interface DrmSessionEventListenerParameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.
-
public final void onDrmKeysRemoved(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)
Deprecated.
Description copied from interface: DrmSessionEventListener
Called each time offline keys are removed.
Specified by:onDrmKeysRemoved in interface DrmSessionEventListenerParameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.
-
public final void onDrmSessionReleased(int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)
Deprecated.
Description copied from interface: DrmSessionEventListener
Called each time a drm session is released.
Specified by:onDrmSessionReleased in interface DrmSessionEventListenerParameters:windowIndex - The window index in the timeline this media period belongs to.mediaPeriodId - The MediaSource.MediaPeriodId associated with the drm session.
-
protected final void sendEvent([AnalyticsListener.EventTime](AnalyticsListener.EventTime.html "class in com.google.android.exoplayer2.analytics")eventTime,
int eventFlag,[ListenerSet.Event](../util/ListenerSet.Event.html "interface in com.google.android.exoplayer2.util")<[AnalyticsListener](AnalyticsListener.html "interface in com.google.android.exoplayer2.analytics")> eventInvocation)
Deprecated.
Sends an event to registered listeners.
Parameters:eventTime - The AnalyticsListener.EventTime to report.eventFlag - An integer flag indicating the type of the event, or C.INDEX_UNSET to report this event without flag.eventInvocation - The event.
-
protected final[AnalyticsListener.EventTime](AnalyticsListener.EventTime.html "class in com.google.android.exoplayer2.analytics")generateCurrentPlayerMediaPeriodEventTime()
Deprecated.
Generates an AnalyticsListener.EventTime for the currently playing item in the player.
-
@RequiresNonNull("player")
protected final[AnalyticsListener.EventTime](AnalyticsListener.EventTime.html "class in com.google.android.exoplayer2.analytics")generateEventTime([Timeline](../Timeline.html "class in com.google.android.exoplayer2")timeline,
int windowIndex,
@Nullable[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")mediaPeriodId)
Deprecated.
Returns a new AnalyticsListener.EventTime for the specified timeline, window and media period id.