Interface AnalyticsListener
-
- All Known Implementing Classes:
EventLogger,ExoHostedTest,MediaMetricsListener,PlaybackStatsListener
public interface AnalyticsListenerA listener for analytics events.All events are recorded with an
AnalyticsListener.EventTimespecifying the elapsed real time and media time at the time of the event.All methods have no-op default implementations to allow selective overrides.
Listeners can choose to implement individual events (e.g.
onIsPlayingChanged(EventTime, boolean)) oronEvents(Player, Events), which is called after one or more events occurred together.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAnalyticsListener.EventFlagsEvents that can be reported viaonEvents(Player, Events).static classAnalyticsListener.EventsA set ofAnalyticsListener.EventFlags.static classAnalyticsListener.EventTimeTime information of an event.
-
Field Summary
Fields Modifier and Type Field Description static intEVENT_AUDIO_ATTRIBUTES_CHANGEDAudio attributes changed.static intEVENT_AUDIO_CODEC_ERRORThe audio codec encountered an error.static intEVENT_AUDIO_DECODER_INITIALIZEDAn audio renderer created a decoder.static intEVENT_AUDIO_DECODER_RELEASEDAn audio renderer released a decoder.static intEVENT_AUDIO_DISABLEDAn audio renderer was disabled.static intEVENT_AUDIO_ENABLEDAn audio renderer was enabled.static intEVENT_AUDIO_INPUT_FORMAT_CHANGEDThe format consumed by an audio renderer changed.static intEVENT_AUDIO_POSITION_ADVANCINGThe audio position has increased for the first time since the last pause or position reset.static intEVENT_AUDIO_SESSION_IDAn audio session id was set.static intEVENT_AUDIO_SINK_ERRORThe audio sink encountered a non-fatal error.static intEVENT_AUDIO_UNDERRUNAn audio underrun occurred.static intEVENT_AVAILABLE_COMMANDS_CHANGEDPlayer.getAvailableCommands()changed.static intEVENT_BANDWIDTH_ESTIMATEThe bandwidth estimate has been updated.static intEVENT_CUESPlayer.getCurrentCues()changed.static intEVENT_DEVICE_INFO_CHANGEDPlayer.getDeviceInfo()changed.static intEVENT_DEVICE_VOLUME_CHANGEDPlayer.getDeviceVolume()changed.static intEVENT_DOWNSTREAM_FORMAT_CHANGEDThe downstream format sent to renderers changed.static intEVENT_DRM_KEYS_LOADEDDRM keys were loaded.static intEVENT_DRM_KEYS_REMOVEDDRM keys were removed.static intEVENT_DRM_KEYS_RESTOREDDRM keys were restored.static intEVENT_DRM_SESSION_ACQUIREDA DRM session has been acquired.static intEVENT_DRM_SESSION_MANAGER_ERRORA non-fatal DRM session manager error occurred.static intEVENT_DRM_SESSION_RELEASEDA DRM session has been released.static intEVENT_DROPPED_VIDEO_FRAMESVideo frames have been dropped.static intEVENT_IS_LOADING_CHANGEDPlayer.isLoading()()} changed.static intEVENT_IS_PLAYING_CHANGEDPlayer.isPlaying()changed.static intEVENT_LOAD_CANCELEDA source canceled loading data.static intEVENT_LOAD_COMPLETEDA source started completed loading data.static intEVENT_LOAD_ERRORA source had a non-fatal error loading data.static intEVENT_LOAD_STARTEDA source started loading data.static intEVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGEDstatic intEVENT_MEDIA_ITEM_TRANSITIONPlayer.getCurrentMediaItem()changed or the player started repeating the current item.static intEVENT_MEDIA_METADATA_CHANGEDPlayer.getMediaMetadata()changed.static intEVENT_METADATAMetadata associated with the current playback time was reported.static intEVENT_PLAY_WHEN_READY_CHANGEDPlayer.getPlayWhenReady()changed.static intEVENT_PLAYBACK_PARAMETERS_CHANGEDPlayer.getPlaybackParameters()changed.static intEVENT_PLAYBACK_STATE_CHANGEDPlayer.getPlaybackState()changed.static intEVENT_PLAYBACK_SUPPRESSION_REASON_CHANGEDstatic intEVENT_PLAYER_ERRORPlayer.getPlayerError()changed.static intEVENT_PLAYER_RELEASEDThe player was released.static intEVENT_PLAYLIST_METADATA_CHANGEDPlayer.getPlaylistMetadata()changed.static intEVENT_POSITION_DISCONTINUITYA position discontinuity occurred.static intEVENT_RENDERED_FIRST_FRAMEThe first frame has been rendered since setting the surface, since the renderer was reset or since the stream changed.static intEVENT_REPEAT_MODE_CHANGEDPlayer.getRepeatMode()changed.static intEVENT_SEEK_BACK_INCREMENT_CHANGEDPlayer.getSeekBackIncrement()changed.static intEVENT_SEEK_FORWARD_INCREMENT_CHANGEDPlayer.getSeekForwardIncrement()changed.static intEVENT_SHUFFLE_MODE_ENABLED_CHANGEDPlayer.getShuffleModeEnabled()changed.static intEVENT_SKIP_SILENCE_ENABLED_CHANGEDSkipping silences was enabled or disabled in the audio stream.static intEVENT_SURFACE_SIZE_CHANGEDThe surface size changed.static intEVENT_TIMELINE_CHANGEDPlayer.getCurrentTimeline()changed.static intEVENT_TRACK_SELECTION_PARAMETERS_CHANGEDPlayer.getTrackSelectionParameters()changed.static intEVENT_TRACKS_CHANGEDstatic intEVENT_UPSTREAM_DISCARDEDData was removed from the end of the media buffer.static intEVENT_VIDEO_CODEC_ERRORThe video codec encountered an error.static intEVENT_VIDEO_DECODER_INITIALIZEDA video renderer created a decoder.static intEVENT_VIDEO_DECODER_RELEASEDA video renderer released a decoder.static intEVENT_VIDEO_DISABLEDA video renderer was disabled.static intEVENT_VIDEO_ENABLEDA video renderer was enabled.static intEVENT_VIDEO_FRAME_PROCESSING_OFFSETVideo frame processing offset data has been reported.static intEVENT_VIDEO_INPUT_FORMAT_CHANGEDThe format consumed by a video renderer changed.static intEVENT_VIDEO_SIZE_CHANGEDThe video size changed.static intEVENT_VOLUME_CHANGEDThe volume changed.
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidonAudioAttributesChanged(AnalyticsListener.EventTime eventTime, AudioAttributes audioAttributes)Called when the audio attributes change.default voidonAudioCodecError(AnalyticsListener.EventTime eventTime, Exception audioCodecError)Called when an audio decoder encounters an error.default voidonAudioDecoderInitialized(AnalyticsListener.EventTime eventTime, String decoderName, long initializationDurationMs)Deprecated.default voidonAudioDecoderInitialized(AnalyticsListener.EventTime eventTime, String decoderName, long initializedTimestampMs, long initializationDurationMs)Called when an audio renderer creates a decoder.default voidonAudioDecoderReleased(AnalyticsListener.EventTime eventTime, String decoderName)Called when an audio renderer releases a decoder.default voidonAudioDisabled(AnalyticsListener.EventTime eventTime, DecoderCounters decoderCounters)Called when an audio renderer is disabled.default voidonAudioEnabled(AnalyticsListener.EventTime eventTime, DecoderCounters decoderCounters)Called when an audio renderer is enabled.default voidonAudioInputFormatChanged(AnalyticsListener.EventTime eventTime, Format format)Deprecated.default voidonAudioInputFormatChanged(AnalyticsListener.EventTime eventTime, Format format, DecoderReuseEvaluation decoderReuseEvaluation)Called when the format of the media being consumed by an audio renderer changes.default voidonAudioPositionAdvancing(AnalyticsListener.EventTime eventTime, long playoutStartSystemTimeMs)Called when the audio position has increased for the first time since the last pause or position reset.default voidonAudioSessionIdChanged(AnalyticsListener.EventTime eventTime, int audioSessionId)Called when the audio session ID changes.default voidonAudioSinkError(AnalyticsListener.EventTime eventTime, Exception audioSinkError)Called whenAudioSinkhas encountered an error.default voidonAudioUnderrun(AnalyticsListener.EventTime eventTime, int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)Called when an audio underrun occurs.default voidonAvailableCommandsChanged(AnalyticsListener.EventTime eventTime, Player.Commands availableCommands)Called when the player's available commands changed.default voidonBandwidthEstimate(AnalyticsListener.EventTime eventTime, int totalLoadTimeMs, long totalBytesLoaded, long bitrateEstimate)Called when the bandwidth estimate for the current data source has been updated.default voidonCues(AnalyticsListener.EventTime eventTime, List<Cue> cues)Called when there is a change in theCues.default voidonDecoderDisabled(AnalyticsListener.EventTime eventTime, int trackType, DecoderCounters decoderCounters)Deprecated.default voidonDecoderEnabled(AnalyticsListener.EventTime eventTime, int trackType, DecoderCounters decoderCounters)Deprecated.default voidonDecoderInitialized(AnalyticsListener.EventTime eventTime, int trackType, String decoderName, long initializationDurationMs)default voidonDecoderInputFormatChanged(AnalyticsListener.EventTime eventTime, int trackType, Format format)default voidonDeviceInfoChanged(AnalyticsListener.EventTime eventTime, DeviceInfo deviceInfo)Called when the device information changesdefault voidonDeviceVolumeChanged(AnalyticsListener.EventTime eventTime, int volume, boolean muted)Called when the device volume or mute state changes.default voidonDownstreamFormatChanged(AnalyticsListener.EventTime eventTime, MediaLoadData mediaLoadData)Called when the downstream format sent to the renderers changed.default voidonDrmKeysLoaded(AnalyticsListener.EventTime eventTime)Called each time drm keys are loaded.default voidonDrmKeysRemoved(AnalyticsListener.EventTime eventTime)Called each time offline drm keys are removed.default voidonDrmKeysRestored(AnalyticsListener.EventTime eventTime)Called each time offline drm keys are restored.default voidonDrmSessionAcquired(AnalyticsListener.EventTime eventTime)Deprecated.ImplementonDrmSessionAcquired(EventTime, int)instead.default voidonDrmSessionAcquired(AnalyticsListener.EventTime eventTime, @com.google.android.exoplayer2.drm.DrmSession.State int state)Called each time a drm session is acquired.default voidonDrmSessionManagerError(AnalyticsListener.EventTime eventTime, Exception error)Called when a drm error occurs.default voidonDrmSessionReleased(AnalyticsListener.EventTime eventTime)Called each time a drm session is released.default voidonDroppedVideoFrames(AnalyticsListener.EventTime eventTime, int droppedFrames, long elapsedMs)Called after video frames have been dropped.default voidonEvents(Player player, AnalyticsListener.Events events)Called after one or more events occurred.default voidonIsLoadingChanged(AnalyticsListener.EventTime eventTime, boolean isLoading)Called when the player starts or stops loading data from a source.default voidonIsPlayingChanged(AnalyticsListener.EventTime eventTime, boolean isPlaying)Called when the player starts or stops playing.default voidonLoadCanceled(AnalyticsListener.EventTime eventTime, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Called when a media source canceled loading data.default voidonLoadCompleted(AnalyticsListener.EventTime eventTime, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Called when a media source completed loading data.default voidonLoadError(AnalyticsListener.EventTime eventTime, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled)Called when a media source loading error occurred.default voidonLoadingChanged(AnalyticsListener.EventTime eventTime, boolean isLoading)Deprecated.UseonIsLoadingChanged(EventTime, boolean)instead.default voidonLoadStarted(AnalyticsListener.EventTime eventTime, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)Called when a media source started loading data.default voidonMaxSeekToPreviousPositionChanged(AnalyticsListener.EventTime eventTime, long maxSeekToPreviousPositionMs)Called when the maximum position for whichPlayer.seekToPrevious()seeks to the previous window changes.default voidonMediaItemTransition(AnalyticsListener.EventTime eventTime, MediaItem mediaItem, @com.google.android.exoplayer2.Player.MediaItemTransitionReason int reason)Called when playback transitions to a different media item.default voidonMediaMetadataChanged(AnalyticsListener.EventTime eventTime, MediaMetadata mediaMetadata)Called when the combinedMediaMetadatachanges.default voidonMetadata(AnalyticsListener.EventTime eventTime, Metadata metadata)Called when there isMetadataassociated with the current playback time.default voidonPlaybackParametersChanged(AnalyticsListener.EventTime eventTime, PlaybackParameters playbackParameters)Called when the playback parameters changed.default voidonPlaybackStateChanged(AnalyticsListener.EventTime eventTime, @com.google.android.exoplayer2.Player.State int state)Called when the playback state changed.default voidonPlaybackSuppressionReasonChanged(AnalyticsListener.EventTime eventTime, @com.google.android.exoplayer2.Player.PlaybackSuppressionReason int playbackSuppressionReason)Called when playback suppression reason changed.default voidonPlayerError(AnalyticsListener.EventTime eventTime, PlaybackException error)Called when a fatal player error occurred.default voidonPlayerErrorChanged(AnalyticsListener.EventTime eventTime, PlaybackException error)Called when thePlaybackExceptionreturned byPlayer.getPlayerError()changes.default voidonPlayerReleased(AnalyticsListener.EventTime eventTime)Called when thePlayeris released.default voidonPlayerStateChanged(AnalyticsListener.EventTime eventTime, boolean playWhenReady, @com.google.android.exoplayer2.Player.State int playbackState)Deprecated.default voidonPlaylistMetadataChanged(AnalyticsListener.EventTime eventTime, MediaMetadata playlistMetadata)Called when the playlistMediaMetadatachanges.default voidonPlayWhenReadyChanged(AnalyticsListener.EventTime eventTime, boolean playWhenReady, @com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int reason)Called when the value changed that indicates whether playback will proceed when ready.default voidonPositionDiscontinuity(AnalyticsListener.EventTime eventTime, @com.google.android.exoplayer2.Player.DiscontinuityReason int reason)Deprecated.default voidonPositionDiscontinuity(AnalyticsListener.EventTime eventTime, Player.PositionInfo oldPosition, Player.PositionInfo newPosition, @com.google.android.exoplayer2.Player.DiscontinuityReason int reason)Called when a position discontinuity occurred.default voidonRenderedFirstFrame(AnalyticsListener.EventTime eventTime, Object output, long renderTimeMs)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.default voidonRepeatModeChanged(AnalyticsListener.EventTime eventTime, @com.google.android.exoplayer2.Player.RepeatMode int repeatMode)Called when the repeat mode changed.default voidonSeekBackIncrementChanged(AnalyticsListener.EventTime eventTime, long seekBackIncrementMs)Called when the seek back increment changed.default voidonSeekForwardIncrementChanged(AnalyticsListener.EventTime eventTime, long seekForwardIncrementMs)Called when the seek forward increment changed.default voidonSeekProcessed(AnalyticsListener.EventTime eventTime)Deprecated.Seeks are processed without delay.default voidonSeekStarted(AnalyticsListener.EventTime eventTime)Deprecated.UseonPositionDiscontinuity(EventTime, Player.PositionInfo, Player.PositionInfo, int)instead, listening to changes withPlayer.DISCONTINUITY_REASON_SEEK.default voidonShuffleModeChanged(AnalyticsListener.EventTime eventTime, boolean shuffleModeEnabled)Called when the shuffle mode changed.default voidonSkipSilenceEnabledChanged(AnalyticsListener.EventTime eventTime, boolean skipSilenceEnabled)Called when skipping silences is enabled or disabled in the audio stream.default voidonSurfaceSizeChanged(AnalyticsListener.EventTime eventTime, int width, int height)Called when the output surface size changed.default voidonTimelineChanged(AnalyticsListener.EventTime eventTime, @com.google.android.exoplayer2.Player.TimelineChangeReason int reason)Called when the timeline changed.default voidonTracksChanged(AnalyticsListener.EventTime eventTime, TrackGroupArray trackGroups, TrackSelectionArray trackSelections)default voidonTrackSelectionParametersChanged(AnalyticsListener.EventTime eventTime, TrackSelectionParameters trackSelectionParameters)Called when track selection parameters change.default voidonTracksInfoChanged(AnalyticsListener.EventTime eventTime, TracksInfo tracksInfo)Called when the available or selected tracks change.default voidonUpstreamDiscarded(AnalyticsListener.EventTime eventTime, MediaLoadData mediaLoadData)Called when data is removed from the back of a media buffer, typically so that it can be re-buffered in a different format.default voidonVideoCodecError(AnalyticsListener.EventTime eventTime, Exception videoCodecError)Called when a video decoder encounters an error.default voidonVideoDecoderInitialized(AnalyticsListener.EventTime eventTime, String decoderName, long initializationDurationMs)Deprecated.default voidonVideoDecoderInitialized(AnalyticsListener.EventTime eventTime, String decoderName, long initializedTimestampMs, long initializationDurationMs)Called when a video renderer creates a decoder.default voidonVideoDecoderReleased(AnalyticsListener.EventTime eventTime, String decoderName)Called when a video renderer releases a decoder.default voidonVideoDisabled(AnalyticsListener.EventTime eventTime, DecoderCounters decoderCounters)Called when a video renderer is disabled.default voidonVideoEnabled(AnalyticsListener.EventTime eventTime, DecoderCounters decoderCounters)Called when a video renderer is enabled.default voidonVideoFrameProcessingOffset(AnalyticsListener.EventTime eventTime, long totalProcessingOffsetUs, int frameCount)Called when there is an update to the video frame processing offset reported by a video renderer.default voidonVideoInputFormatChanged(AnalyticsListener.EventTime eventTime, Format format)Deprecated.default voidonVideoInputFormatChanged(AnalyticsListener.EventTime eventTime, Format format, DecoderReuseEvaluation decoderReuseEvaluation)Called when the format of the media being consumed by a video renderer changes.default voidonVideoSizeChanged(AnalyticsListener.EventTime eventTime, int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio)Deprecated.ImplementonVideoSizeChanged(EventTime eventTime, VideoSize)instead.default voidonVideoSizeChanged(AnalyticsListener.EventTime eventTime, VideoSize videoSize)Called before a frame is rendered for the first time since setting the surface, and each time there's a change in the size or pixel aspect ratio of the video being rendered.default voidonVolumeChanged(AnalyticsListener.EventTime eventTime, float volume)Called when the volume changes.
-
-
-
Field Detail
-
EVENT_TIMELINE_CHANGED
static final int EVENT_TIMELINE_CHANGED
Player.getCurrentTimeline()changed.- See Also:
- Constant Field Values
-
EVENT_MEDIA_ITEM_TRANSITION
static final int EVENT_MEDIA_ITEM_TRANSITION
Player.getCurrentMediaItem()changed or the player started repeating the current item.- See Also:
- Constant Field Values
-
EVENT_TRACKS_CHANGED
static final int EVENT_TRACKS_CHANGED
Player.getCurrentTracksInfo(),Player.getCurrentTrackGroups()orPlayer.getCurrentTrackSelections()changed.- See Also:
- Constant Field Values
-
EVENT_IS_LOADING_CHANGED
static final int EVENT_IS_LOADING_CHANGED
Player.isLoading()()} changed.- See Also:
- Constant Field Values
-
EVENT_PLAYBACK_STATE_CHANGED
static final int EVENT_PLAYBACK_STATE_CHANGED
Player.getPlaybackState()changed.- See Also:
- Constant Field Values
-
EVENT_PLAY_WHEN_READY_CHANGED
static final int EVENT_PLAY_WHEN_READY_CHANGED
Player.getPlayWhenReady()changed.- See Also:
- Constant Field Values
-
EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED
static final int EVENT_PLAYBACK_SUPPRESSION_REASON_CHANGED
- See Also:
- Constant Field Values
-
EVENT_IS_PLAYING_CHANGED
static final int EVENT_IS_PLAYING_CHANGED
Player.isPlaying()changed.- See Also:
- Constant Field Values
-
EVENT_REPEAT_MODE_CHANGED
static final int EVENT_REPEAT_MODE_CHANGED
Player.getRepeatMode()changed.- See Also:
- Constant Field Values
-
EVENT_SHUFFLE_MODE_ENABLED_CHANGED
static final int EVENT_SHUFFLE_MODE_ENABLED_CHANGED
Player.getShuffleModeEnabled()changed.- See Also:
- Constant Field Values
-
EVENT_PLAYER_ERROR
static final int EVENT_PLAYER_ERROR
Player.getPlayerError()changed.- See Also:
- Constant Field Values
-
EVENT_POSITION_DISCONTINUITY
static final int EVENT_POSITION_DISCONTINUITY
A position discontinuity occurred. SeePlayer.Listener.onPositionDiscontinuity(Player.PositionInfo, Player.PositionInfo, int).- See Also:
- Constant Field Values
-
EVENT_PLAYBACK_PARAMETERS_CHANGED
static final int EVENT_PLAYBACK_PARAMETERS_CHANGED
Player.getPlaybackParameters()changed.- See Also:
- Constant Field Values
-
EVENT_AVAILABLE_COMMANDS_CHANGED
static final int EVENT_AVAILABLE_COMMANDS_CHANGED
Player.getAvailableCommands()changed.- See Also:
- Constant Field Values
-
EVENT_MEDIA_METADATA_CHANGED
static final int EVENT_MEDIA_METADATA_CHANGED
Player.getMediaMetadata()changed.- See Also:
- Constant Field Values
-
EVENT_PLAYLIST_METADATA_CHANGED
static final int EVENT_PLAYLIST_METADATA_CHANGED
Player.getPlaylistMetadata()changed.- See Also:
- Constant Field Values
-
EVENT_SEEK_BACK_INCREMENT_CHANGED
static final int EVENT_SEEK_BACK_INCREMENT_CHANGED
Player.getSeekBackIncrement()changed.- See Also:
- Constant Field Values
-
EVENT_SEEK_FORWARD_INCREMENT_CHANGED
static final int EVENT_SEEK_FORWARD_INCREMENT_CHANGED
Player.getSeekForwardIncrement()changed.- See Also:
- Constant Field Values
-
EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED
static final int EVENT_MAX_SEEK_TO_PREVIOUS_POSITION_CHANGED
- See Also:
- Constant Field Values
-
EVENT_TRACK_SELECTION_PARAMETERS_CHANGED
static final int EVENT_TRACK_SELECTION_PARAMETERS_CHANGED
Player.getTrackSelectionParameters()changed.- See Also:
- Constant Field Values
-
EVENT_AUDIO_ATTRIBUTES_CHANGED
static final int EVENT_AUDIO_ATTRIBUTES_CHANGED
Audio attributes changed.- See Also:
- Constant Field Values
-
EVENT_AUDIO_SESSION_ID
static final int EVENT_AUDIO_SESSION_ID
An audio session id was set.- See Also:
- Constant Field Values
-
EVENT_VOLUME_CHANGED
static final int EVENT_VOLUME_CHANGED
The volume changed.- See Also:
- Constant Field Values
-
EVENT_SKIP_SILENCE_ENABLED_CHANGED
static final int EVENT_SKIP_SILENCE_ENABLED_CHANGED
Skipping silences was enabled or disabled in the audio stream.- See Also:
- Constant Field Values
-
EVENT_SURFACE_SIZE_CHANGED
static final int EVENT_SURFACE_SIZE_CHANGED
The surface size changed.- See Also:
- Constant Field Values
-
EVENT_VIDEO_SIZE_CHANGED
static final int EVENT_VIDEO_SIZE_CHANGED
The video size changed.- See Also:
- Constant Field Values
-
EVENT_RENDERED_FIRST_FRAME
static final int EVENT_RENDERED_FIRST_FRAME
The first frame has been rendered since setting the surface, since the renderer was reset or since the stream changed.- See Also:
- Constant Field Values
-
EVENT_METADATA
static final int EVENT_METADATA
Metadata associated with the current playback time was reported.- See Also:
- Constant Field Values
-
EVENT_CUES
static final int EVENT_CUES
Player.getCurrentCues()changed.- See Also:
- Constant Field Values
-
EVENT_DEVICE_INFO_CHANGED
static final int EVENT_DEVICE_INFO_CHANGED
Player.getDeviceInfo()changed.- See Also:
- Constant Field Values
-
EVENT_DEVICE_VOLUME_CHANGED
static final int EVENT_DEVICE_VOLUME_CHANGED
Player.getDeviceVolume()changed.- See Also:
- Constant Field Values
-
EVENT_LOAD_STARTED
static final int EVENT_LOAD_STARTED
A source started loading data.- See Also:
- Constant Field Values
-
EVENT_LOAD_COMPLETED
static final int EVENT_LOAD_COMPLETED
A source started completed loading data.- See Also:
- Constant Field Values
-
EVENT_LOAD_CANCELED
static final int EVENT_LOAD_CANCELED
A source canceled loading data.- See Also:
- Constant Field Values
-
EVENT_LOAD_ERROR
static final int EVENT_LOAD_ERROR
A source had a non-fatal error loading data.- See Also:
- Constant Field Values
-
EVENT_DOWNSTREAM_FORMAT_CHANGED
static final int EVENT_DOWNSTREAM_FORMAT_CHANGED
The downstream format sent to renderers changed.- See Also:
- Constant Field Values
-
EVENT_UPSTREAM_DISCARDED
static final int EVENT_UPSTREAM_DISCARDED
Data was removed from the end of the media buffer.- See Also:
- Constant Field Values
-
EVENT_BANDWIDTH_ESTIMATE
static final int EVENT_BANDWIDTH_ESTIMATE
The bandwidth estimate has been updated.- See Also:
- Constant Field Values
-
EVENT_AUDIO_ENABLED
static final int EVENT_AUDIO_ENABLED
An audio renderer was enabled.- See Also:
- Constant Field Values
-
EVENT_AUDIO_DECODER_INITIALIZED
static final int EVENT_AUDIO_DECODER_INITIALIZED
An audio renderer created a decoder.- See Also:
- Constant Field Values
-
EVENT_AUDIO_INPUT_FORMAT_CHANGED
static final int EVENT_AUDIO_INPUT_FORMAT_CHANGED
The format consumed by an audio renderer changed.- See Also:
- Constant Field Values
-
EVENT_AUDIO_POSITION_ADVANCING
static final int EVENT_AUDIO_POSITION_ADVANCING
The audio position has increased for the first time since the last pause or position reset.- See Also:
- Constant Field Values
-
EVENT_AUDIO_UNDERRUN
static final int EVENT_AUDIO_UNDERRUN
An audio underrun occurred.- See Also:
- Constant Field Values
-
EVENT_AUDIO_DECODER_RELEASED
static final int EVENT_AUDIO_DECODER_RELEASED
An audio renderer released a decoder.- See Also:
- Constant Field Values
-
EVENT_AUDIO_DISABLED
static final int EVENT_AUDIO_DISABLED
An audio renderer was disabled.- See Also:
- Constant Field Values
-
EVENT_AUDIO_SINK_ERROR
static final int EVENT_AUDIO_SINK_ERROR
The audio sink encountered a non-fatal error.- See Also:
- Constant Field Values
-
EVENT_VIDEO_ENABLED
static final int EVENT_VIDEO_ENABLED
A video renderer was enabled.- See Also:
- Constant Field Values
-
EVENT_VIDEO_DECODER_INITIALIZED
static final int EVENT_VIDEO_DECODER_INITIALIZED
A video renderer created a decoder.- See Also:
- Constant Field Values
-
EVENT_VIDEO_INPUT_FORMAT_CHANGED
static final int EVENT_VIDEO_INPUT_FORMAT_CHANGED
The format consumed by a video renderer changed.- See Also:
- Constant Field Values
-
EVENT_DROPPED_VIDEO_FRAMES
static final int EVENT_DROPPED_VIDEO_FRAMES
Video frames have been dropped.- See Also:
- Constant Field Values
-
EVENT_VIDEO_DECODER_RELEASED
static final int EVENT_VIDEO_DECODER_RELEASED
A video renderer released a decoder.- See Also:
- Constant Field Values
-
EVENT_VIDEO_DISABLED
static final int EVENT_VIDEO_DISABLED
A video renderer was disabled.- See Also:
- Constant Field Values
-
EVENT_VIDEO_FRAME_PROCESSING_OFFSET
static final int EVENT_VIDEO_FRAME_PROCESSING_OFFSET
Video frame processing offset data has been reported.- See Also:
- Constant Field Values
-
EVENT_DRM_SESSION_ACQUIRED
static final int EVENT_DRM_SESSION_ACQUIRED
A DRM session has been acquired.- See Also:
- Constant Field Values
-
EVENT_DRM_KEYS_LOADED
static final int EVENT_DRM_KEYS_LOADED
DRM keys were loaded.- See Also:
- Constant Field Values
-
EVENT_DRM_SESSION_MANAGER_ERROR
static final int EVENT_DRM_SESSION_MANAGER_ERROR
A non-fatal DRM session manager error occurred.- See Also:
- Constant Field Values
-
EVENT_DRM_KEYS_RESTORED
static final int EVENT_DRM_KEYS_RESTORED
DRM keys were restored.- See Also:
- Constant Field Values
-
EVENT_DRM_KEYS_REMOVED
static final int EVENT_DRM_KEYS_REMOVED
DRM keys were removed.- See Also:
- Constant Field Values
-
EVENT_DRM_SESSION_RELEASED
static final int EVENT_DRM_SESSION_RELEASED
A DRM session has been released.- See Also:
- Constant Field Values
-
EVENT_PLAYER_RELEASED
static final int EVENT_PLAYER_RELEASED
The player was released.- See Also:
- Constant Field Values
-
EVENT_AUDIO_CODEC_ERROR
static final int EVENT_AUDIO_CODEC_ERROR
The audio codec encountered an error.- See Also:
- Constant Field Values
-
EVENT_VIDEO_CODEC_ERROR
static final int EVENT_VIDEO_CODEC_ERROR
The video codec encountered an error.- See Also:
- Constant Field Values
-
-
Method Detail
-
onPlayerStateChanged
@Deprecated default void onPlayerStateChanged(AnalyticsListener.EventTime eventTime, boolean playWhenReady, @State @com.google.android.exoplayer2.Player.State int playbackState)
Deprecated.
-
onPlaybackStateChanged
default void onPlaybackStateChanged(AnalyticsListener.EventTime eventTime, @State @com.google.android.exoplayer2.Player.State int state)
Called when the playback state changed.- Parameters:
eventTime- The event time.state- The newplayback state.
-
onPlayWhenReadyChanged
default void onPlayWhenReadyChanged(AnalyticsListener.EventTime eventTime, boolean playWhenReady, @PlayWhenReadyChangeReason @com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int reason)
Called when the value changed that indicates whether playback will proceed when ready.- Parameters:
eventTime- The event time.playWhenReady- Whether playback will proceed when ready.reason- Thereasonof the change.
-
onPlaybackSuppressionReasonChanged
default void onPlaybackSuppressionReasonChanged(AnalyticsListener.EventTime eventTime, @PlaybackSuppressionReason @com.google.android.exoplayer2.Player.PlaybackSuppressionReason int playbackSuppressionReason)
Called when playback suppression reason changed.- Parameters:
eventTime- The event time.playbackSuppressionReason- The newPlayer.PlaybackSuppressionReason.
-
onIsPlayingChanged
default void onIsPlayingChanged(AnalyticsListener.EventTime eventTime, boolean isPlaying)
Called when the player starts or stops playing.- Parameters:
eventTime- The event time.isPlaying- Whether the player is playing.
-
onTimelineChanged
default void onTimelineChanged(AnalyticsListener.EventTime eventTime, @TimelineChangeReason @com.google.android.exoplayer2.Player.TimelineChangeReason int reason)
Called when the timeline changed.- Parameters:
eventTime- The event time.reason- The reason for the timeline change.
-
onMediaItemTransition
default void onMediaItemTransition(AnalyticsListener.EventTime eventTime, @Nullable MediaItem mediaItem, @MediaItemTransitionReason @com.google.android.exoplayer2.Player.MediaItemTransitionReason int reason)
Called when playback transitions to a different media item.- Parameters:
eventTime- The event time.mediaItem- The media item.reason- The reason for the media item transition.
-
onPositionDiscontinuity
@Deprecated default void onPositionDiscontinuity(AnalyticsListener.EventTime eventTime, @DiscontinuityReason @com.google.android.exoplayer2.Player.DiscontinuityReason int reason)
Deprecated.
-
onPositionDiscontinuity
default void onPositionDiscontinuity(AnalyticsListener.EventTime eventTime, Player.PositionInfo oldPosition, Player.PositionInfo newPosition, @DiscontinuityReason @com.google.android.exoplayer2.Player.DiscontinuityReason int reason)
Called when a position discontinuity occurred.- Parameters:
eventTime- The event time.oldPosition- The position before the discontinuity.newPosition- The position after the discontinuity.reason- The reason for the position discontinuity.
-
onSeekStarted
@Deprecated default void onSeekStarted(AnalyticsListener.EventTime eventTime)
Deprecated.UseonPositionDiscontinuity(EventTime, Player.PositionInfo, Player.PositionInfo, int)instead, listening to changes withPlayer.DISCONTINUITY_REASON_SEEK.
-
onSeekProcessed
@Deprecated default void onSeekProcessed(AnalyticsListener.EventTime eventTime)
Deprecated.Seeks are processed without delay. UseonPositionDiscontinuity(EventTime, int)with reasonPlayer.DISCONTINUITY_REASON_SEEKinstead.
-
onPlaybackParametersChanged
default void onPlaybackParametersChanged(AnalyticsListener.EventTime eventTime, PlaybackParameters playbackParameters)
Called when the playback parameters changed.- Parameters:
eventTime- The event time.playbackParameters- The new playback parameters.
-
onSeekBackIncrementChanged
default void onSeekBackIncrementChanged(AnalyticsListener.EventTime eventTime, long seekBackIncrementMs)
Called when the seek back increment changed.- Parameters:
eventTime- The event time.seekBackIncrementMs- The seek back increment, in milliseconds.
-
onSeekForwardIncrementChanged
default void onSeekForwardIncrementChanged(AnalyticsListener.EventTime eventTime, long seekForwardIncrementMs)
Called when the seek forward increment changed.- Parameters:
eventTime- The event time.seekForwardIncrementMs- The seek forward increment, in milliseconds.
-
onMaxSeekToPreviousPositionChanged
default void onMaxSeekToPreviousPositionChanged(AnalyticsListener.EventTime eventTime, long maxSeekToPreviousPositionMs)
Called when the maximum position for whichPlayer.seekToPrevious()seeks to the previous window changes.- Parameters:
eventTime- The event time.maxSeekToPreviousPositionMs- The maximum seek to previous position, in milliseconds.
-
onRepeatModeChanged
default void onRepeatModeChanged(AnalyticsListener.EventTime eventTime, @RepeatMode @com.google.android.exoplayer2.Player.RepeatMode int repeatMode)
Called when the repeat mode changed.- Parameters:
eventTime- The event time.repeatMode- The new repeat mode.
-
onShuffleModeChanged
default void onShuffleModeChanged(AnalyticsListener.EventTime eventTime, boolean shuffleModeEnabled)
Called when the shuffle mode changed.- Parameters:
eventTime- The event time.shuffleModeEnabled- Whether the shuffle mode is enabled.
-
onIsLoadingChanged
default void onIsLoadingChanged(AnalyticsListener.EventTime eventTime, boolean isLoading)
Called when the player starts or stops loading data from a source.- Parameters:
eventTime- The event time.isLoading- Whether the player is loading.
-
onLoadingChanged
@Deprecated default void onLoadingChanged(AnalyticsListener.EventTime eventTime, boolean isLoading)
Deprecated.UseonIsLoadingChanged(EventTime, boolean)instead.
-
onAvailableCommandsChanged
default void onAvailableCommandsChanged(AnalyticsListener.EventTime eventTime, Player.Commands availableCommands)
Called when the player's available commands changed.- Parameters:
eventTime- The event time.availableCommands- The available commands.
-
onPlayerError
default void onPlayerError(AnalyticsListener.EventTime eventTime, PlaybackException error)
Called when a fatal player error occurred.Implementations of
Playermay pass an instance of a subclass ofPlaybackExceptionto this method in order to include more information about the error.- Parameters:
eventTime- The event time.error- The error.
-
onPlayerErrorChanged
default void onPlayerErrorChanged(AnalyticsListener.EventTime eventTime, @Nullable PlaybackException error)
Called when thePlaybackExceptionreturned byPlayer.getPlayerError()changes.Implementations of Player may pass an instance of a subclass of
PlaybackExceptionto this method in order to include more information about the error.- Parameters:
eventTime- The event time.error- The new error, or null if the error is being cleared.
-
onTracksChanged
@Deprecated default void onTracksChanged(AnalyticsListener.EventTime eventTime, TrackGroupArray trackGroups, TrackSelectionArray trackSelections)
Deprecated.Called when the available or selected tracks for the renderers changed.- Parameters:
eventTime- The event time.trackGroups- The available tracks. May be empty.trackSelections- The track selections for each renderer. May contain null elements.
-
onTracksInfoChanged
default void onTracksInfoChanged(AnalyticsListener.EventTime eventTime, TracksInfo tracksInfo)
Called when the available or selected tracks change.- Parameters:
eventTime- The event time.tracksInfo- The available tracks information. Never null, but may be of length zero.
-
onTrackSelectionParametersChanged
default void onTrackSelectionParametersChanged(AnalyticsListener.EventTime eventTime, TrackSelectionParameters trackSelectionParameters)
Called when track selection parameters change.- Parameters:
eventTime- The event time.trackSelectionParameters- The newTrackSelectionParameters.
-
onMediaMetadataChanged
default void onMediaMetadataChanged(AnalyticsListener.EventTime eventTime, MediaMetadata mediaMetadata)
Called when the combinedMediaMetadatachanges.The provided
MediaMetadatais a combination of theMediaItem.mediaMetadataand the static and dynamic metadata from thetrack selections' formatsandMetadataOutput.onMetadata(Metadata).- Parameters:
eventTime- The event time.mediaMetadata- The combinedMediaMetadata.
-
onPlaylistMetadataChanged
default void onPlaylistMetadataChanged(AnalyticsListener.EventTime eventTime, MediaMetadata playlistMetadata)
Called when the playlistMediaMetadatachanges.- Parameters:
eventTime- The event time.playlistMetadata- The playlistMediaMetadata.
-
onLoadStarted
default void onLoadStarted(AnalyticsListener.EventTime eventTime, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)
Called when a media source started loading data.- Parameters:
eventTime- The event time.loadEventInfo- TheLoadEventInfodefining the load event.mediaLoadData- TheMediaLoadDatadefining the data being loaded.
-
onLoadCompleted
default void onLoadCompleted(AnalyticsListener.EventTime eventTime, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)
Called when a media source completed loading data.- Parameters:
eventTime- The event time.loadEventInfo- TheLoadEventInfodefining the load event.mediaLoadData- TheMediaLoadDatadefining the data being loaded.
-
onLoadCanceled
default void onLoadCanceled(AnalyticsListener.EventTime eventTime, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData)
Called when a media source canceled loading data.- Parameters:
eventTime- The event time.loadEventInfo- TheLoadEventInfodefining the load event.mediaLoadData- TheMediaLoadDatadefining the data being loaded.
-
onLoadError
default void onLoadError(AnalyticsListener.EventTime eventTime, LoadEventInfo loadEventInfo, MediaLoadData mediaLoadData, IOException error, boolean wasCanceled)
Called when a media source loading error occurred.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.- Parameters:
eventTime- The event time.loadEventInfo- TheLoadEventInfodefining the load event.mediaLoadData- TheMediaLoadDatadefining the data being loaded.error- The load error.wasCanceled- Whether the load was canceled as a result of the error.
-
onDownstreamFormatChanged
default void onDownstreamFormatChanged(AnalyticsListener.EventTime eventTime, MediaLoadData mediaLoadData)
Called when the downstream format sent to the renderers changed.- Parameters:
eventTime- The event time.mediaLoadData- TheMediaLoadDatadefining the newly selected media data.
-
onUpstreamDiscarded
default void onUpstreamDiscarded(AnalyticsListener.EventTime eventTime, MediaLoadData mediaLoadData)
Called when data is removed from the back of a media buffer, typically so that it can be re-buffered in a different format.- Parameters:
eventTime- The event time.mediaLoadData- TheMediaLoadDatadefining the media being discarded.
-
onBandwidthEstimate
default void onBandwidthEstimate(AnalyticsListener.EventTime eventTime, int totalLoadTimeMs, long totalBytesLoaded, long bitrateEstimate)
Called when the bandwidth estimate for the current data source has been updated.- Parameters:
eventTime- The event time.totalLoadTimeMs- The total time spend loading this update is based on, in milliseconds.totalBytesLoaded- The total bytes loaded this update is based on.bitrateEstimate- The bandwidth estimate, in bits per second.
-
onMetadata
default void onMetadata(AnalyticsListener.EventTime eventTime, Metadata metadata)
Called when there isMetadataassociated with the current playback time.- Parameters:
eventTime- The event time.metadata- The metadata.
-
onCues
default void onCues(AnalyticsListener.EventTime eventTime, List<Cue> cues)
Called when there is a change in theCues.cuesis in ascending order of priority. If any of the cue boxes overlap when displayed, theCuenearer the end of the list should be shown on top.- Parameters:
eventTime- The event time.cues- TheCues. May be empty.
-
onDecoderEnabled
@Deprecated default void onDecoderEnabled(AnalyticsListener.EventTime eventTime, int trackType, DecoderCounters decoderCounters)
Deprecated.
-
onDecoderInitialized
@Deprecated default void onDecoderInitialized(AnalyticsListener.EventTime eventTime, int trackType, String decoderName, long initializationDurationMs)
-
onDecoderInputFormatChanged
@Deprecated default void onDecoderInputFormatChanged(AnalyticsListener.EventTime eventTime, int trackType, Format format)
-
onDecoderDisabled
@Deprecated default void onDecoderDisabled(AnalyticsListener.EventTime eventTime, int trackType, DecoderCounters decoderCounters)
Deprecated.
-
onAudioEnabled
default void onAudioEnabled(AnalyticsListener.EventTime eventTime, DecoderCounters decoderCounters)
Called when an audio renderer is enabled.- Parameters:
eventTime- The event time.decoderCounters-DecoderCountersthat will be updated by the renderer for as long as it remains enabled.
-
onAudioDecoderInitialized
default void onAudioDecoderInitialized(AnalyticsListener.EventTime eventTime, String decoderName, long initializedTimestampMs, long initializationDurationMs)
Called when an audio renderer creates a decoder.- Parameters:
eventTime- The event time.decoderName- The decoder that was created.initializedTimestampMs-SystemClock.elapsedRealtime()when initialization finished.initializationDurationMs- The time taken to initialize the decoder in milliseconds.
-
onAudioDecoderInitialized
@Deprecated default void onAudioDecoderInitialized(AnalyticsListener.EventTime eventTime, String decoderName, long initializationDurationMs)
Deprecated.
-
onAudioInputFormatChanged
@Deprecated default void onAudioInputFormatChanged(AnalyticsListener.EventTime eventTime, Format format)
Deprecated.
-
onAudioInputFormatChanged
default void onAudioInputFormatChanged(AnalyticsListener.EventTime eventTime, Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation)
Called when the format of the media being consumed by an audio renderer changes.- Parameters:
eventTime- The event time.format- The new format.decoderReuseEvaluation- The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, ornullif the renderer did not have a decoder.
-
onAudioPositionAdvancing
default void onAudioPositionAdvancing(AnalyticsListener.EventTime eventTime, long playoutStartSystemTimeMs)
Called when the audio position has increased for the first time since the last pause or position reset.- Parameters:
eventTime- The event time.playoutStartSystemTimeMs- The approximate derivedSystem.currentTimeMillis()at which playout started.
-
onAudioUnderrun
default void onAudioUnderrun(AnalyticsListener.EventTime eventTime, int bufferSize, long bufferSizeMs, long elapsedSinceLastFeedMs)
Called when an audio underrun occurs.- Parameters:
eventTime- The event time.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_UNSETif the output buffer contains non-PCM encoded audio.elapsedSinceLastFeedMs- The time since audio was last written to the output buffer.
-
onAudioDecoderReleased
default void onAudioDecoderReleased(AnalyticsListener.EventTime eventTime, String decoderName)
Called when an audio renderer releases a decoder.- Parameters:
eventTime- The event time.decoderName- The decoder that was released.
-
onAudioDisabled
default void onAudioDisabled(AnalyticsListener.EventTime eventTime, DecoderCounters decoderCounters)
Called when an audio renderer is disabled.- Parameters:
eventTime- The event time.decoderCounters-DecoderCountersthat were updated by the renderer.
-
onAudioSessionIdChanged
default void onAudioSessionIdChanged(AnalyticsListener.EventTime eventTime, int audioSessionId)
Called when the audio session ID changes.- Parameters:
eventTime- The event time.audioSessionId- The audio session ID.
-
onAudioAttributesChanged
default void onAudioAttributesChanged(AnalyticsListener.EventTime eventTime, AudioAttributes audioAttributes)
Called when the audio attributes change.- Parameters:
eventTime- The event time.audioAttributes- The audio attributes.
-
onSkipSilenceEnabledChanged
default void onSkipSilenceEnabledChanged(AnalyticsListener.EventTime eventTime, boolean skipSilenceEnabled)
Called when skipping silences is enabled or disabled in the audio stream.- Parameters:
eventTime- The event time.skipSilenceEnabled- Whether skipping silences in the audio stream is enabled.
-
onAudioSinkError
default void onAudioSinkError(AnalyticsListener.EventTime eventTime, Exception audioSinkError)
Called whenAudioSinkhas encountered 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.- Parameters:
eventTime- The event time.audioSinkError- The error that occurred. Typically anAudioSink.InitializationException, aAudioSink.WriteException, or anAudioSink.UnexpectedDiscontinuityException.
-
onAudioCodecError
default void onAudioCodecError(AnalyticsListener.EventTime eventTime, Exception audioCodecError)
Called when an audio 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.- Parameters:
eventTime- The event time.audioCodecError- The error. Typically aMediaCodec.CodecExceptionif the renderer usesMediaCodec, or aDecoderExceptionif the renderer uses a software decoder.
-
onVolumeChanged
default void onVolumeChanged(AnalyticsListener.EventTime eventTime, float volume)
Called when the volume changes.- Parameters:
eventTime- The event time.volume- The new volume, with 0 being silence and 1 being unity gain.
-
onDeviceInfoChanged
default void onDeviceInfoChanged(AnalyticsListener.EventTime eventTime, DeviceInfo deviceInfo)
Called when the device information changes- Parameters:
eventTime- The event time.deviceInfo- The newDeviceInfo.
-
onDeviceVolumeChanged
default void onDeviceVolumeChanged(AnalyticsListener.EventTime eventTime, int volume, boolean muted)
Called when the device volume or mute state changes.- Parameters:
eventTime- The event time.volume- The new device volume, with 0 being silence and 1 being unity gain.muted- Whether the device is muted.
-
onVideoEnabled
default void onVideoEnabled(AnalyticsListener.EventTime eventTime, DecoderCounters decoderCounters)
Called when a video renderer is enabled.- Parameters:
eventTime- The event time.decoderCounters-DecoderCountersthat will be updated by the renderer for as long as it remains enabled.
-
onVideoDecoderInitialized
default void onVideoDecoderInitialized(AnalyticsListener.EventTime eventTime, String decoderName, long initializedTimestampMs, long initializationDurationMs)
Called when a video renderer creates a decoder.- Parameters:
eventTime- The event time.decoderName- The decoder that was created.initializedTimestampMs-SystemClock.elapsedRealtime()when initialization finished.initializationDurationMs- The time taken to initialize the decoder in milliseconds.
-
onVideoDecoderInitialized
@Deprecated default void onVideoDecoderInitialized(AnalyticsListener.EventTime eventTime, String decoderName, long initializationDurationMs)
Deprecated.
-
onVideoInputFormatChanged
@Deprecated default void onVideoInputFormatChanged(AnalyticsListener.EventTime eventTime, Format format)
Deprecated.
-
onVideoInputFormatChanged
default void onVideoInputFormatChanged(AnalyticsListener.EventTime eventTime, Format format, @Nullable DecoderReuseEvaluation decoderReuseEvaluation)
Called when the format of the media being consumed by a video renderer changes.- Parameters:
eventTime- The event time.format- The new format.decoderReuseEvaluation- The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, ornullif the renderer did not have a decoder.
-
onDroppedVideoFrames
default void onDroppedVideoFrames(AnalyticsListener.EventTime eventTime, int droppedFrames, long elapsedMs)
Called after video frames have been dropped.- Parameters:
eventTime- The event time.droppedFrames- The number of dropped frames since the last call to this method.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.
-
onVideoDecoderReleased
default void onVideoDecoderReleased(AnalyticsListener.EventTime eventTime, String decoderName)
Called when a video renderer releases a decoder.- Parameters:
eventTime- The event time.decoderName- The decoder that was released.
-
onVideoDisabled
default void onVideoDisabled(AnalyticsListener.EventTime eventTime, DecoderCounters decoderCounters)
Called when a video renderer is disabled.- Parameters:
eventTime- The event time.decoderCounters-DecoderCountersthat were updated by the renderer.
-
onVideoFrameProcessingOffset
default void onVideoFrameProcessingOffset(AnalyticsListener.EventTime eventTime, long totalProcessingOffsetUs, int frameCount)
Called when there is an update to the video frame processing offset reported by a video renderer.The processing offset for a video frame is the difference between the time at which the frame became available to render, and the time at which it was scheduled to be rendered. A positive value indicates the frame became available early enough, whereas a negative value indicates that the frame wasn't available until after the time at which it should have been rendered.
- Parameters:
eventTime- The event time.totalProcessingOffsetUs- The sum of the video frame processing offsets for frames rendered since the last call to this method.frameCount- The number to samples included intotalProcessingOffsetUs.
-
onVideoCodecError
default void onVideoCodecError(AnalyticsListener.EventTime eventTime, Exception videoCodecError)
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.- Parameters:
eventTime- The event time.videoCodecError- The error. Typically aMediaCodec.CodecExceptionif the renderer usesMediaCodec, or aDecoderExceptionif the renderer uses a software decoder.
-
onRenderedFirstFrame
default void onRenderedFirstFrame(AnalyticsListener.EventTime eventTime, Object output, long renderTimeMs)
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.- Parameters:
eventTime- The event time.output- The output to which a frame has been rendered. Normally aSurface, however may also be other output types (e.g., aVideoDecoderOutputBufferRenderer).renderTimeMs-SystemClock.elapsedRealtime()when the first frame was rendered.
-
onVideoSizeChanged
default void onVideoSizeChanged(AnalyticsListener.EventTime eventTime, VideoSize videoSize)
Called before a frame is rendered for the first time since setting the surface, and each time there's a change in the size or pixel aspect ratio of the video being rendered.- Parameters:
eventTime- The event time.videoSize- The new size of the video.
-
onVideoSizeChanged
@Deprecated default void onVideoSizeChanged(AnalyticsListener.EventTime eventTime, int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio)
Deprecated.ImplementonVideoSizeChanged(EventTime eventTime, VideoSize)instead.
-
onSurfaceSizeChanged
default void onSurfaceSizeChanged(AnalyticsListener.EventTime eventTime, int width, int height)
Called when the output surface size changed.- Parameters:
eventTime- The event time.width- The surface width in pixels. May beC.LENGTH_UNSETif unknown, or 0 if the video is not rendered onto a surface.height- The surface height in pixels. May beC.LENGTH_UNSETif unknown, or 0 if the video is not rendered onto a surface.
-
onDrmSessionAcquired
@Deprecated default void onDrmSessionAcquired(AnalyticsListener.EventTime eventTime)
Deprecated.ImplementonDrmSessionAcquired(EventTime, int)instead.
-
onDrmSessionAcquired
default void onDrmSessionAcquired(AnalyticsListener.EventTime eventTime, @State @com.google.android.exoplayer2.drm.DrmSession.State int state)
Called each time a drm session is acquired.- Parameters:
eventTime- The event time.state- TheDrmSession.Stateof the session when the acquisition completed.
-
onDrmKeysLoaded
default void onDrmKeysLoaded(AnalyticsListener.EventTime eventTime)
Called each time drm keys are loaded.- Parameters:
eventTime- The event time.
-
onDrmSessionManagerError
default void onDrmSessionManagerError(AnalyticsListener.EventTime eventTime, Exception error)
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. 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.- Parameters:
eventTime- The event time.error- The error.
-
onDrmKeysRestored
default void onDrmKeysRestored(AnalyticsListener.EventTime eventTime)
Called each time offline drm keys are restored.- Parameters:
eventTime- The event time.
-
onDrmKeysRemoved
default void onDrmKeysRemoved(AnalyticsListener.EventTime eventTime)
Called each time offline drm keys are removed.- Parameters:
eventTime- The event time.
-
onDrmSessionReleased
default void onDrmSessionReleased(AnalyticsListener.EventTime eventTime)
Called each time a drm session is released.- Parameters:
eventTime- The event time.
-
onPlayerReleased
default void onPlayerReleased(AnalyticsListener.EventTime eventTime)
Called when thePlayeris released.- Parameters:
eventTime- The event time.
-
onEvents
default void onEvents(Player player, AnalyticsListener.Events events)
Called after one or more events occurred.State changes and events that happen within one
Loopermessage 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
onPlaybackStateChanged(EventTime, int)andonPlayWhenReadyChanged(EventTime, boolean, int)). - They need access to the
Playerobject to trigger further events (e.g. to callPlayer.seekTo(long)after aonMediaItemTransition(EventTime, MediaItem, int)). - They intend to use multiple state values together or in combination with
Playergetter methods. For example usingPlayer.getCurrentMediaItemIndex()with thetimelineprovided inonTimelineChanged(EventTime, int)is only safe from within this method. - They are interested in events that logically happened together (e.g
onPlaybackStateChanged(EventTime, int)toPlayer.STATE_BUFFERINGbecause ofonMediaItemTransition(EventTime, MediaItem, int)).
- Parameters:
player- ThePlayer.events- TheAnalyticsListener.Eventsthat occurred in this iteration.
- They intend to trigger the same logic for multiple events (e.g. when updating a UI for
both
-
-