class EventLogger : AnalyticsListener


Logs events from Player and other core components using Log.

Summary

Public constructors

Creates an instance.

Creates an instance.

This function is deprecated.

Use EventLogger

This function is deprecated.

Use EventLogger

Public functions

Unit
@UnstableApi
onAudioAttributesChanged(
    eventTime: AnalyticsListener.EventTime!,
    audioAttributes: AudioAttributes!
)

Called when the audio attributes change.

Unit
@UnstableApi
onAudioDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!,
    initializedTimestampMs: Long,
    initializationDurationMs: Long
)

Called when an audio renderer creates a decoder.

Unit
@UnstableApi
onAudioDecoderReleased(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!
)

Called when an audio renderer releases a decoder.

Unit
@UnstableApi
onAudioDisabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
)

Called when an audio renderer is disabled.

Unit
@UnstableApi
onAudioEnabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
)

Called when an audio renderer is enabled.

Unit
@UnstableApi
onAudioInputFormatChanged(
    eventTime: AnalyticsListener.EventTime!,
    format: Format!,
    decoderReuseEvaluation: DecoderReuseEvaluation?
)

Called when the format of the media being consumed by an audio renderer changes.

Unit
@UnstableApi
onAudioSessionIdChanged(
    eventTime: AnalyticsListener.EventTime!,
    audioSessionId: Int
)

Called when the audio session ID changes.

Unit

Called when an AudioTrack has been initialized.

Unit

Called when an AudioTrack has been released.

Unit
@UnstableApi
onAudioUnderrun(
    eventTime: AnalyticsListener.EventTime!,
    bufferSize: Int,
    bufferSizeMs: Long,
    elapsedSinceLastFeedMs: Long
)

Called when an audio underrun occurs.

Unit

Called when the downstream format sent to the renderers changed.

Unit

Called each time drm keys are loaded.

Unit

Called each time offline drm keys are removed.

Unit

Called each time offline drm keys are restored.

Unit

Called each time a drm session is acquired.

Unit

Called when a drm error occurs.

Unit

Called each time a drm session is released.

Unit
@UnstableApi
onDroppedVideoFrames(
    eventTime: AnalyticsListener.EventTime!,
    droppedFrames: Int,
    elapsedMs: Long
)

Called after video frames have been dropped.

Unit
@UnstableApi
onIsLoadingChanged(
    eventTime: AnalyticsListener.EventTime!,
    isLoading: Boolean
)

Called when the player starts or stops loading data from a source.

Unit
@UnstableApi
onIsPlayingChanged(
    eventTime: AnalyticsListener.EventTime!,
    isPlaying: Boolean
)

Called when the player starts or stops playing.

Unit
@UnstableApi
onLoadError(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!,
    error: IOException!,
    wasCanceled: Boolean
)

Called when a media source loading error occurred.

Unit
@UnstableApi
onMediaItemTransition(
    eventTime: AnalyticsListener.EventTime!,
    mediaItem: MediaItem?,
    reason: Int
)

Called when playback transitions to a different media item.

Unit

Called when there is Metadata associated with the current playback time.

Unit
@UnstableApi
onPlayWhenReadyChanged(
    eventTime: AnalyticsListener.EventTime!,
    playWhenReady: Boolean,
    @Player.PlayWhenReadyChangeReason reason: Int
)

Called when the value changed that indicates whether playback will proceed when ready.

Unit

Called when the playback parameters changed.

Unit

Called when the playback state changed.

Unit

Called when playback suppression reason changed.

Unit

Called when a fatal player error occurred.

Unit
@UnstableApi
onPositionDiscontinuity(
    eventTime: AnalyticsListener.EventTime!,
    oldPosition: Player.PositionInfo!,
    newPosition: Player.PositionInfo!,
    @Player.DiscontinuityReason reason: Int
)

Called when a position discontinuity occurred.

Unit
@UnstableApi
onRenderedFirstFrame(
    eventTime: AnalyticsListener.EventTime!,
    output: Any!,
    renderTimeMs: Long
)

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.

Unit
@UnstableApi
onRendererReadyChanged(
    eventTime: AnalyticsListener.EventTime!,
    rendererIndex: Int,
    @C.TrackType rendererTrackType: Int,
    isRendererReady: Boolean
)

Called each time a renderer starts or stops allowing playback to be ready.

Unit

Called when the repeat mode changed.

Unit
@UnstableApi
onShuffleModeChanged(
    eventTime: AnalyticsListener.EventTime!,
    shuffleModeEnabled: Boolean
)

Called when the shuffle mode changed.

Unit
@UnstableApi
onSkipSilenceEnabledChanged(
    eventTime: AnalyticsListener.EventTime!,
    skipSilenceEnabled: Boolean
)

Called when skipping silences is enabled or disabled in the audio stream.

Unit
@UnstableApi
onSurfaceSizeChanged(
    eventTime: AnalyticsListener.EventTime!,
    width: Int,
    height: Int
)

Called when the output surface size changed.

Unit

Called when the timeline changed.

Unit

Called when the tracks change.

Unit
@UnstableApi
onUpstreamDiscarded(
    eventTime: AnalyticsListener.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.

Unit
@UnstableApi
onVideoDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!,
    initializedTimestampMs: Long,
    initializationDurationMs: Long
)

Called when a video renderer creates a decoder.

Unit
@UnstableApi
onVideoDecoderReleased(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!
)

Called when a video renderer releases a decoder.

Unit
@UnstableApi
onVideoDisabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
)

Called when a video renderer is disabled.

Unit
@UnstableApi
onVideoEnabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
)

Called when a video renderer is enabled.

Unit
@UnstableApi
onVideoInputFormatChanged(
    eventTime: AnalyticsListener.EventTime!,
    format: Format!,
    decoderReuseEvaluation: DecoderReuseEvaluation?
)

Called when the format of the media being consumed by a video renderer changes.

Unit
@UnstableApi
onVideoSizeChanged(
    eventTime: AnalyticsListener.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.

Unit

Called when the volume changes.

Protected functions

Unit

Logs a debug message.

Unit

Logs an error message.

Inherited Constants

From androidx.media3.exoplayer.analytics.AnalyticsListener
const Int

Audio attributes changed.

const Int

The audio codec encountered an error.

const Int

An audio renderer created a decoder.

const Int

An audio renderer released a decoder.

const Int

An audio renderer was disabled.

const Int

An audio renderer was enabled.

const Int

The format consumed by an audio renderer changed.

const Int

The audio position has increased for the first time since the last pause or position reset.

const Int

An audio session id was set.

const Int

The audio sink encountered a non-fatal error.

const Int

An audio track has been initialized.

const Int

An audio track has been released.

const Int

An audio underrun occurred.

const Int

getAvailableCommands changed.

const Int

The bandwidth estimate has been updated.

const Int

getCurrentCues changed.

const Int

getDeviceInfo changed.

const Int

getDeviceVolume changed.

const Int

The downstream format sent to renderers changed.

const Int

DRM keys were loaded.

const Int

DRM keys were removed.

const Int

DRM keys were restored.

const Int

A DRM session has been acquired.

const Int

A non-fatal DRM session manager error occurred.

const Int

A DRM session has been released.

const Int

Video frames have been dropped.

const Int

isLoading ()} changed.

const Int

isPlaying changed.

const Int

A source canceled loading data.

const Int

A source started completed loading data.

const Int

A source had a non-fatal error loading data.

const Int

A source started loading data.

const Int

getMaxSeekToPreviousPosition changed.

const Int

getCurrentMediaItem changed or the player started repeating the current item.

const Int

getMediaMetadata changed.

const Int

Metadata associated with the current playback time was reported.

const Int

getPlaybackParameters changed.

const Int

getPlaybackState changed.

const Int

getPlaybackSuppressionReason changed.

const Int

getPlayerError changed.

const Int

The player was released.

const Int

getPlaylistMetadata changed.

const Int

getPlayWhenReady changed.

const Int

A position discontinuity occurred.

const Int

The first frame has been rendered since setting the surface, since the renderer was reset or since the stream changed.

const Int

A renderer changed its readiness for playback.

const Int

getRepeatMode changed.

const Int

getSeekBackIncrement changed.

const Int

getSeekForwardIncrement changed.

const Int

getShuffleModeEnabled changed.

const Int

Skipping silences was enabled or disabled in the audio stream.

const Int

The surface size changed.

const Int

getCurrentTimeline changed.

const Int

getCurrentTracks changed.

const Int

getTrackSelectionParameters changed.

const Int

Data was removed from the end of the media buffer.

const Int

The video codec encountered an error.

const Int

A video renderer created a decoder.

const Int

A video renderer released a decoder.

const Int

A video renderer was disabled.

const Int

A video renderer was enabled.

const Int

Video frame processing offset data has been reported.

const Int

The format consumed by a video renderer changed.

const Int

The video size changed.

const Int

The volume changed.

Inherited functions

From androidx.media3.exoplayer.analytics.AnalyticsListener
Unit
@UnstableApi
onAudioCodecError(
    eventTime: AnalyticsListener.EventTime!,
    audioCodecError: Exception!
)

Called when an audio decoder encounters an error.

Unit
@UnstableApi
onAudioDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!,
    initializationDurationMs: Long
)

This function is deprecated.

Use onAudioDecoderInitialized.

Unit
@UnstableApi
onAudioPositionAdvancing(
    eventTime: AnalyticsListener.EventTime!,
    playoutStartSystemTimeMs: Long
)

Called when the audio position has increased for the first time since the last pause or position reset.

Unit
@UnstableApi
onAudioSinkError(
    eventTime: AnalyticsListener.EventTime!,
    audioSinkError: Exception!
)

Called when AudioSink has encountered an error.

Unit
@UnstableApi
onAvailableCommandsChanged(
    eventTime: AnalyticsListener.EventTime!,
    availableCommands: Player.Commands!
)

Called when the player's available commands changed.

Unit
@UnstableApi
onBandwidthEstimate(
    eventTime: AnalyticsListener.EventTime!,
    totalLoadTimeMs: Int,
    totalBytesLoaded: Long,
    bitrateEstimate: Long
)

Called when the bandwidth estimate for the current data source has been updated.

Unit

Called when there is a change in the CueGroup.

Unit

This function is deprecated.

Use onCues instead.

Unit
@UnstableApi
onDeviceInfoChanged(
    eventTime: AnalyticsListener.EventTime!,
    deviceInfo: DeviceInfo!
)

Called when the device information changes

Unit
@UnstableApi
onDeviceVolumeChanged(
    eventTime: AnalyticsListener.EventTime!,
    volume: Int,
    muted: Boolean
)

Called when the device volume or mute state changes.

Unit

This function is deprecated.

Implement onDrmSessionAcquired instead.

Unit

Called after one or more events occurred.

Unit
@UnstableApi
onLoadCanceled(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!
)

Called when a media source canceled loading data.

Unit
@UnstableApi
onLoadCompleted(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!
)

Called when a media source completed loading data.

Unit
@UnstableApi
onLoadStarted(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!
)

Called when a media source started loading data.

Unit
@UnstableApi
onLoadingChanged(
    eventTime: AnalyticsListener.EventTime!,
    isLoading: Boolean
)

This function is deprecated.

Use onIsLoadingChanged instead.

Unit
@UnstableApi
onMaxSeekToPreviousPositionChanged(
    eventTime: AnalyticsListener.EventTime!,
    maxSeekToPreviousPositionMs: Long
)

Called when the maximum position for which seekToPrevious seeks to the previous window changes.

Unit
@UnstableApi
onMediaMetadataChanged(
    eventTime: AnalyticsListener.EventTime!,
    mediaMetadata: MediaMetadata!
)

Called when the combined MediaMetadata changes.

Unit

Called when the PlaybackException returned by getPlayerError changes.

Unit

Called when the Player is released.

Unit
@UnstableApi
onPlayerStateChanged(
    eventTime: AnalyticsListener.EventTime!,
    playWhenReady: Boolean,
    @Player.State playbackState: Int
)

This function is deprecated.

Use onPlaybackStateChanged and onPlayWhenReadyChanged instead.

Unit
@UnstableApi
onPlaylistMetadataChanged(
    eventTime: AnalyticsListener.EventTime!,
    playlistMetadata: MediaMetadata!
)

Called when the playlist MediaMetadata changes.

Unit

This function is deprecated.

Use onPositionDiscontinuity instead.

Unit
@UnstableApi
onSeekBackIncrementChanged(
    eventTime: AnalyticsListener.EventTime!,
    seekBackIncrementMs: Long
)

Called when the seek back increment changed.

Unit
@UnstableApi
onSeekForwardIncrementChanged(
    eventTime: AnalyticsListener.EventTime!,
    seekForwardIncrementMs: Long
)

Called when the seek forward increment changed.

Unit

This function is deprecated.

Use onPositionDiscontinuity instead, listening to changes with DISCONTINUITY_REASON_SEEK.

Unit

Called when track selection parameters change.

Unit
@UnstableApi
onVideoCodecError(
    eventTime: AnalyticsListener.EventTime!,
    videoCodecError: Exception!
)

Called when a video decoder encounters an error.

Unit
@UnstableApi
onVideoDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!,
    initializationDurationMs: Long
)

This function is deprecated.

Use onVideoDecoderInitialized.

Unit
@UnstableApi
onVideoFrameProcessingOffset(
    eventTime: AnalyticsListener.EventTime!,
    totalProcessingOffsetUs: Long,
    frameCount: Int
)

Called when there is an update to the video frame processing offset reported by a video renderer.

Unit
@UnstableApi
onVideoSizeChanged(
    eventTime: AnalyticsListener.EventTime!,
    width: Int,
    height: Int,
    unappliedRotationDegrees: Int,
    pixelWidthHeightRatio: Float
)

This function is deprecated.

Implement onVideoSizeChanged instead.

Public constructors

EventLogger

EventLogger()

Creates an instance.

EventLogger

EventLogger(tag: String!)

Creates an instance.

Parameters
tag: String!

The tag used for logging.

EventLogger

@UnstableApi
EventLogger(trackSelector: MappingTrackSelector?)

Creates an instance.

Parameters
trackSelector: MappingTrackSelector?

This parameter is ignored.

EventLogger

@UnstableApi
EventLogger(trackSelector: MappingTrackSelector?, tag: String!)

Creates an instance.

Parameters
trackSelector: MappingTrackSelector?

This parameter is ignored.

tag: String!

The tag used for logging.

Public functions

onAudioAttributesChanged

@UnstableApi
fun onAudioAttributesChanged(
    eventTime: AnalyticsListener.EventTime!,
    audioAttributes: AudioAttributes!
): Unit

Called when the audio attributes change.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

audioAttributes: AudioAttributes!

The audio attributes.

onAudioDecoderInitialized

@UnstableApi
fun onAudioDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!,
    initializedTimestampMs: Long,
    initializationDurationMs: Long
): Unit

Called when an audio renderer creates a decoder.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

decoderName: String!

The decoder that was created.

initializedTimestampMs: Long

elapsedRealtime when initialization finished.

initializationDurationMs: Long

The time taken to initialize the decoder in milliseconds.

onAudioDecoderReleased

@UnstableApi
fun onAudioDecoderReleased(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!
): Unit

Called when an audio renderer releases a decoder.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

decoderName: String!

The decoder that was released.

onAudioDisabled

@UnstableApi
fun onAudioDisabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
): Unit

Called when an audio renderer is disabled.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

decoderCounters: DecoderCounters!

DecoderCounters that were updated by the renderer.

onAudioEnabled

@UnstableApi
fun onAudioEnabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
): Unit

Called when an audio renderer is enabled.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

decoderCounters: DecoderCounters!

DecoderCounters that will be updated by the renderer for as long as it remains enabled.

onAudioInputFormatChanged

@UnstableApi
fun onAudioInputFormatChanged(
    eventTime: AnalyticsListener.EventTime!,
    format: Format!,
    decoderReuseEvaluation: DecoderReuseEvaluation?
): Unit

Called when the format of the media being consumed by an audio renderer changes.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

format: Format!

The new format.

decoderReuseEvaluation: 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.

onAudioSessionIdChanged

@UnstableApi
fun onAudioSessionIdChanged(
    eventTime: AnalyticsListener.EventTime!,
    audioSessionId: Int
): Unit

Called when the audio session ID changes.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

audioSessionId: Int

The audio session ID.

onAudioTrackInitialized

@UnstableApi
fun onAudioTrackInitialized(
    eventTime: AnalyticsListener.EventTime!,
    audioTrackConfig: AudioSink.AudioTrackConfig!
): Unit

Called when an AudioTrack has been initialized.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

audioTrackConfig: AudioSink.AudioTrackConfig!

The AudioSink.AudioTrackConfig of the initialized .

onAudioTrackReleased

@UnstableApi
fun onAudioTrackReleased(
    eventTime: AnalyticsListener.EventTime!,
    audioTrackConfig: AudioSink.AudioTrackConfig!
): Unit

Called when an AudioTrack has been released.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

audioTrackConfig: AudioSink.AudioTrackConfig!

The AudioSink.AudioTrackConfig of the released .

onAudioUnderrun

@UnstableApi
fun onAudioUnderrun(
    eventTime: AnalyticsListener.EventTime!,
    bufferSize: Int,
    bufferSizeMs: Long,
    elapsedSinceLastFeedMs: Long
): Unit

Called when an audio underrun occurs.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

bufferSize: Int

The size of the audio output buffer, in bytes.

bufferSizeMs: Long

The size of the audio output buffer, in milliseconds, if it contains PCM encoded audio. TIME_UNSET if the output buffer contains non-PCM encoded audio.

elapsedSinceLastFeedMs: Long

The time since audio was last written to the output buffer.

onDownstreamFormatChanged

@UnstableApi
fun onDownstreamFormatChanged(
    eventTime: AnalyticsListener.EventTime!,
    mediaLoadData: MediaLoadData!
): Unit

Called when the downstream format sent to the renderers changed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

mediaLoadData: MediaLoadData!

The MediaLoadData defining the newly selected media data.

onDrmKeysLoaded

@UnstableApi
fun onDrmKeysLoaded(eventTime: AnalyticsListener.EventTime!): Unit

Called each time drm keys are loaded.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

onDrmKeysRemoved

@UnstableApi
fun onDrmKeysRemoved(eventTime: AnalyticsListener.EventTime!): Unit

Called each time offline drm keys are removed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

onDrmKeysRestored

@UnstableApi
fun onDrmKeysRestored(eventTime: AnalyticsListener.EventTime!): Unit

Called each time offline drm keys are restored.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

onDrmSessionAcquired

@UnstableApi
fun onDrmSessionAcquired(
    eventTime: AnalyticsListener.EventTime!,
    @DrmSession.State state: Int
): Unit

Called each time a drm session is acquired.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

@DrmSession.State state: Int

The DrmSession.State of the session when the acquisition completed.

onDrmSessionManagerError

@UnstableApi
fun onDrmSessionManagerError(
    eventTime: AnalyticsListener.EventTime!,
    error: Exception!
): Unit

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. onPlayerError 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: AnalyticsListener.EventTime!

The event time.

error: Exception!

The error.

onDrmSessionReleased

@UnstableApi
fun onDrmSessionReleased(eventTime: AnalyticsListener.EventTime!): Unit

Called each time a drm session is released.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

onDroppedVideoFrames

@UnstableApi
fun onDroppedVideoFrames(
    eventTime: AnalyticsListener.EventTime!,
    droppedFrames: Int,
    elapsedMs: Long
): Unit

Called after video frames have been dropped.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

droppedFrames: Int

The number of dropped frames since the last call to this method.

elapsedMs: Long

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.

onIsLoadingChanged

@UnstableApi
fun onIsLoadingChanged(
    eventTime: AnalyticsListener.EventTime!,
    isLoading: Boolean
): Unit

Called when the player starts or stops loading data from a source.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

isLoading: Boolean

Whether the player is loading.

onIsPlayingChanged

@UnstableApi
fun onIsPlayingChanged(
    eventTime: AnalyticsListener.EventTime!,
    isPlaying: Boolean
): Unit

Called when the player starts or stops playing.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

isPlaying: Boolean

Whether the player is playing.

onLoadError

@UnstableApi
fun onLoadError(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!,
    error: IOException!,
    wasCanceled: Boolean
): Unit

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. onPlayerError 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: AnalyticsListener.EventTime!

The event time.

loadEventInfo: LoadEventInfo!

The LoadEventInfo defining the load event.

mediaLoadData: MediaLoadData!

The MediaLoadData defining the data being loaded.

error: IOException!

The load error.

wasCanceled: Boolean

Whether the load was canceled as a result of the error.

onMediaItemTransition

@UnstableApi
fun onMediaItemTransition(
    eventTime: AnalyticsListener.EventTime!,
    mediaItem: MediaItem?,
    reason: Int
): Unit

Called when playback transitions to a different media item.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

mediaItem: MediaItem?

The media item.

reason: Int

The reason for the media item transition.

onMetadata

@UnstableApi
fun onMetadata(eventTime: AnalyticsListener.EventTime!, metadata: Metadata!): Unit

Called when there is Metadata associated with the current playback time.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

metadata: Metadata!

The metadata.

onPlayWhenReadyChanged

@UnstableApi
fun onPlayWhenReadyChanged(
    eventTime: AnalyticsListener.EventTime!,
    playWhenReady: Boolean,
    @Player.PlayWhenReadyChangeReason reason: Int
): Unit

Called when the value changed that indicates whether playback will proceed when ready.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

playWhenReady: Boolean

Whether playback will proceed when ready.

@Player.PlayWhenReadyChangeReason reason: Int

The reason of the change.

onPlaybackParametersChanged

@UnstableApi
fun onPlaybackParametersChanged(
    eventTime: AnalyticsListener.EventTime!,
    playbackParameters: PlaybackParameters!
): Unit

Called when the playback parameters changed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

playbackParameters: PlaybackParameters!

The new playback parameters.

onPlaybackStateChanged

@UnstableApi
fun onPlaybackStateChanged(
    eventTime: AnalyticsListener.EventTime!,
    @Player.State state: Int
): Unit

Called when the playback state changed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

@Player.State state: Int

The new playback state.

onPlaybackSuppressionReasonChanged

@UnstableApi
fun onPlaybackSuppressionReasonChanged(
    eventTime: AnalyticsListener.EventTime!,
    @Player.PlaybackSuppressionReason playbackSuppressionReason: Int
): Unit

Called when playback suppression reason changed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

@Player.PlaybackSuppressionReason playbackSuppressionReason: Int

The new PlaybackSuppressionReason.

onPlayerError

@UnstableApi
fun onPlayerError(
    eventTime: AnalyticsListener.EventTime!,
    error: PlaybackException!
): Unit

Called when a fatal player error occurred.

Implementations of Player may pass an instance of a subclass of to this method in order to include more information about the error.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

error: PlaybackException!

The error.

onPositionDiscontinuity

@UnstableApi
fun onPositionDiscontinuity(
    eventTime: AnalyticsListener.EventTime!,
    oldPosition: Player.PositionInfo!,
    newPosition: Player.PositionInfo!,
    @Player.DiscontinuityReason reason: Int
): Unit

Called when a position discontinuity occurred.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

oldPosition: Player.PositionInfo!

The position before the discontinuity.

newPosition: Player.PositionInfo!

The position after the discontinuity.

@Player.DiscontinuityReason reason: Int

The reason for the position discontinuity.

onRenderedFirstFrame

@UnstableApi
fun onRenderedFirstFrame(
    eventTime: AnalyticsListener.EventTime!,
    output: Any!,
    renderTimeMs: Long
): Unit

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: AnalyticsListener.EventTime!

The event time.

output: Any!

The output to which a frame has been rendered. Normally a Surface, however may also be other output types (e.g., a VideoDecoderOutputBufferRenderer).

renderTimeMs: Long

elapsedRealtime when the first frame was rendered.

onRendererReadyChanged

@UnstableApi
fun onRendererReadyChanged(
    eventTime: AnalyticsListener.EventTime!,
    rendererIndex: Int,
    @C.TrackType rendererTrackType: Int,
    isRendererReady: Boolean
): Unit

Called each time a renderer starts or stops allowing playback to be ready.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

rendererIndex: Int

The index of the renderer in the instance.

@C.TrackType rendererTrackType: Int

The C.TrackType of the renderer.

isRendererReady: Boolean

Whether the renderer allows playback to be ready.

onRepeatModeChanged

@UnstableApi
fun onRepeatModeChanged(
    eventTime: AnalyticsListener.EventTime!,
    @Player.RepeatMode repeatMode: Int
): Unit

Called when the repeat mode changed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

@Player.RepeatMode repeatMode: Int

The new repeat mode.

onShuffleModeChanged

@UnstableApi
fun onShuffleModeChanged(
    eventTime: AnalyticsListener.EventTime!,
    shuffleModeEnabled: Boolean
): Unit

Called when the shuffle mode changed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

shuffleModeEnabled: Boolean

Whether the shuffle mode is enabled.

onSkipSilenceEnabledChanged

@UnstableApi
fun onSkipSilenceEnabledChanged(
    eventTime: AnalyticsListener.EventTime!,
    skipSilenceEnabled: Boolean
): Unit

Called when skipping silences is enabled or disabled in the audio stream.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

skipSilenceEnabled: Boolean

Whether skipping silences in the audio stream is enabled.

onSurfaceSizeChanged

@UnstableApi
fun onSurfaceSizeChanged(
    eventTime: AnalyticsListener.EventTime!,
    width: Int,
    height: Int
): Unit

Called when the output surface size changed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

width: Int

The surface width in pixels. May be LENGTH_UNSET if unknown, or 0 if the video is not rendered onto a surface.

height: Int

The surface height in pixels. May be LENGTH_UNSET if unknown, or 0 if the video is not rendered onto a surface.

onTimelineChanged

@UnstableApi
fun onTimelineChanged(
    eventTime: AnalyticsListener.EventTime!,
    @Player.TimelineChangeReason reason: Int
): Unit

Called when the timeline changed.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

@Player.TimelineChangeReason reason: Int

The reason for the timeline change.

onTracksChanged

@UnstableApi
fun onTracksChanged(eventTime: AnalyticsListener.EventTime!, tracks: Tracks!): Unit

Called when the tracks change.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

tracks: Tracks!

The tracks. Never null, but may be of length zero.

onUpstreamDiscarded

@UnstableApi
fun onUpstreamDiscarded(
    eventTime: AnalyticsListener.EventTime!,
    mediaLoadData: MediaLoadData!
): Unit

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: AnalyticsListener.EventTime!

The event time.

mediaLoadData: MediaLoadData!

The MediaLoadData defining the media being discarded.

onVideoDecoderInitialized

@UnstableApi
fun onVideoDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!,
    initializedTimestampMs: Long,
    initializationDurationMs: Long
): Unit

Called when a video renderer creates a decoder.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

decoderName: String!

The decoder that was created.

initializedTimestampMs: Long

elapsedRealtime when initialization finished.

initializationDurationMs: Long

The time taken to initialize the decoder in milliseconds.

onVideoDecoderReleased

@UnstableApi
fun onVideoDecoderReleased(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!
): Unit

Called when a video renderer releases a decoder.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

decoderName: String!

The decoder that was released.

onVideoDisabled

@UnstableApi
fun onVideoDisabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
): Unit

Called when a video renderer is disabled.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

decoderCounters: DecoderCounters!

DecoderCounters that were updated by the renderer.

onVideoEnabled

@UnstableApi
fun onVideoEnabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
): Unit

Called when a video renderer is enabled.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

decoderCounters: DecoderCounters!

DecoderCounters that will be updated by the renderer for as long as it remains enabled.

onVideoInputFormatChanged

@UnstableApi
fun onVideoInputFormatChanged(
    eventTime: AnalyticsListener.EventTime!,
    format: Format!,
    decoderReuseEvaluation: DecoderReuseEvaluation?
): Unit

Called when the format of the media being consumed by a video renderer changes.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

format: Format!

The new format.

decoderReuseEvaluation: 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.

onVideoSizeChanged

@UnstableApi
fun onVideoSizeChanged(
    eventTime: AnalyticsListener.EventTime!,
    videoSize: VideoSize!
): Unit

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: AnalyticsListener.EventTime!

The event time.

videoSize: VideoSize!

The new size of the video.

onVolumeChanged

@UnstableApi
fun onVolumeChanged(eventTime: AnalyticsListener.EventTime!, volume: Float): Unit

Called when the volume changes.

Parameters
eventTime: AnalyticsListener.EventTime!

The event time.

volume: Float

The new volume, with 0 being silence and 1 being unity gain.

Protected functions

logd

@UnstableApi
protected fun logd(msg: String!): Unit

Logs a debug message.

Parameters
msg: String!

The message to log.

loge

@UnstableApi
protected fun loge(msg: String!): Unit

Logs an error message.

Parameters
msg: String!

The message to log.