# DefaultAnalyticsCollector

# DefaultAnalyticsCollector

Artifact:[androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector.java+class:androidx.media3.exoplayer.analytics.DefaultAnalyticsCollector)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector "View this page in Java")

<br />

```
@UnstableApi
class DefaultAnalyticsCollector : AnalyticsCollector
```

<br />

*** ** * ** ***

Data collector that forwards analytics events to[AnalyticsListeners](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener).

## Summary

|                                                                                                                                                            ### Public constructors                                                                                                                                                            |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DefaultAnalyticsCollector](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#DefaultAnalyticsCollector(androidx.media3.common.util.Clock))`(clock: `[Clock](https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock)`!)` Creates an analytics collector. |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | `@`[CallSuper](https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper) [addListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#addListener(androidx.media3.exoplayer.analytics.AnalyticsListener))`(listener: `[AnalyticsListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener)`!)` Adds a listener for analytics events.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [notifySeekStarted](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#notifySeekStarted())`()` Notifies the analytics collector that a seek operation will start.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioAttributesChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioAttributesChanged(androidx.media3.common.AudioAttributes))`(audioAttributes: `[AudioAttributes](https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes)`!)` Called when the value of[getAudioAttributes](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getAudioAttributes())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioCodecError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioCodecError(java.lang.Exception))`(audioCodecError: `[Exception](https://developer.android.com/reference/java/lang/Exception.html)`!)` Called when an audio decoder encounters an error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioDecoderInitialized](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioDecoderInitialized(java.lang.String,long,long))`(` ` decoderName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` initializedTimestampMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` initializationDurationMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)` Called when a audio decoder is created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioDecoderReleased](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioDecoderReleased(java.lang.String))`(decoderName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Called when a audio decoder is released.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioDisabled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioDisabled(androidx.media3.exoplayer.DecoderCounters))`(counters: `[DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)`!)` Called when the audio renderer is disabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioEnabled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioEnabled(androidx.media3.exoplayer.DecoderCounters))`(counters: `[DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)`!)` Called when the audio renderer is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioInputFormatChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioInputFormatChanged(androidx.media3.common.Format,androidx.media3.exoplayer.DecoderReuseEvaluation))`(` ` format: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!,` ` decoderReuseEvaluation: `[DecoderReuseEvaluation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation)`?` `)` Called when the format of the media being consumed by the audio renderer changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioPositionAdvancing](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioPositionAdvancing(long))`(playoutStartSystemTimeMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Called when the audio position has increased for the first time since the last pause or position reset.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioSessionIdChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioSessionIdChanged(int))`(audioSessionId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called when the audio session ID changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioSinkError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioSinkError(java.lang.Exception))`(audioSinkError: `[Exception](https://developer.android.com/reference/java/lang/Exception.html)`!)` Called when[AudioSink](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink)has encountered an error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioTrackInitialized](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioTrackInitialized(androidx.media3.exoplayer.audio.AudioSink.AudioTrackConfig))`(audioTrackConfig: `[AudioSink.AudioTrackConfig](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.AudioTrackConfig)`!)` Called when an[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html)has been initialized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioTrackReleased](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioTrackReleased(androidx.media3.exoplayer.audio.AudioSink.AudioTrackConfig))`(audioTrackConfig: `[AudioSink.AudioTrackConfig](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.AudioTrackConfig)`!)` Called when an[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html)has been released.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAudioUnderrun](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAudioUnderrun(int,long,long))`(` ` bufferSize: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` bufferSizeMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` elapsedSinceLastFeedMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)` Called when an audio underrun occurs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onAvailableCommandsChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onAvailableCommandsChanged(androidx.media3.common.Player.Commands))`(availableCommands: `[Player.Commands](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands)`!)` Called when the value returned from[isCommandAvailable](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#isCommandAvailable(int))changes for at least one[Command](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command).                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onBandwidthSample](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onBandwidthSample(int,long,long))`(` ` elapsedMs: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` bytesTransferred: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` bitrateEstimate: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)` Called periodically to indicate that bytes have been transferred or the estimated bitrate has changed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onCues](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onCues(androidx.media3.common.text.CueGroup))`(cueGroup: `[CueGroup](https://developer.android.com/reference/kotlin/androidx/media3/common/text/CueGroup)`!)` Called when the value of[getCurrentCues](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentCues())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onCues](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onCues(java.util.List<androidx.media3.common.text.Cue>))`(cues: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Cue](https://developer.android.com/reference/kotlin/androidx/media3/common/text/Cue)`!>!)` **This function is deprecated.** Use[onCues](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onCues(androidx.media3.common.text.CueGroup))instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDeviceInfoChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDeviceInfoChanged(androidx.media3.common.DeviceInfo))`(deviceInfo: `[DeviceInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo)`!)` Called when the device information changes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDeviceVolumeChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDeviceVolumeChanged(int,boolean))`(volume: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, muted: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when the value of[getDeviceVolume](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getDeviceVolume())or[isDeviceMuted](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#isDeviceMuted())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDownstreamFormatChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDownstreamFormatChanged(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.MediaLoadData))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!` `)` Called when a downstream format change occurs (i.e. when the format of the media being read from one or more[SampleStream](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SampleStream)s provided by the source changes).                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrmKeysLoaded](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDrmKeysLoaded(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.drm.KeyRequestInfo))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` keyRequestInfo: `[KeyRequestInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/KeyRequestInfo)`!` `)` Called each time keys are loaded.                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrmKeysRemoved](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDrmKeysRemoved(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` `)` Called each time offline keys are removed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrmKeysRestored](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDrmKeysRestored(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` `)` Called each time offline keys are restored.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrmSessionAcquired](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDrmSessionAcquired(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,int))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` @`[DrmSession.State](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSession.State)` state: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Called each time a drm session is acquired.                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrmSessionManagerError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDrmSessionManagerError(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,java.lang.Exception))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` error: `[Exception](https://developer.android.com/reference/java/lang/Exception.html)`!` `)` Called when a drm error occurs.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrmSessionReleased](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDrmSessionReleased(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` `)` Called each time a drm session is released.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDroppedFrames](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDroppedFrames(int,long))`(count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, elapsedMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Called to report the number of frames dropped by the video renderer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDroppedSeeksWhileScrubbing](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onDroppedSeeksWhileScrubbing(int))`(droppedSeekCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called when seeks are dropped when scrubbing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onEvents](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))`(player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!, events: `[Player.Events](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events)`!)` Called when one or more player states changed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onIsLoadingChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onIsLoadingChanged(boolean))`(isLoading: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when the player starts or stops loading the source.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onIsPlayingChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onIsPlayingChanged(boolean))`(isPlaying: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when the value of[isPlaying](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#isPlaying())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onLoadCanceled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onLoadCanceled(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.source.MediaLoadData))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` loadEventInfo: `[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)`!,` ` mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!` `)` Called when a load is canceled.                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onLoadCompleted](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onLoadCompleted(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.source.MediaLoadData))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` loadEventInfo: `[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)`!,` ` mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!` `)` Called when a load ends.                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onLoadError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onLoadError(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.source.MediaLoadData,java.io.IOException,boolean))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` loadEventInfo: `[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)`!,` ` mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!,` ` error: `[IOException](https://developer.android.com/reference/java/io/IOException.html)`!,` ` wasCanceled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Called when a load error occurs. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onLoadStarted](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onLoadStarted(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.source.MediaLoadData,int))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` loadEventInfo: `[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)`!,` ` mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!,` ` retryCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Called when a load begins.                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onLoadingChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onLoadingChanged(boolean))`(isLoading: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` **This function is deprecated.** Use[onIsLoadingChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onIsLoadingChanged(boolean))instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onMaxSeekToPreviousPositionChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onMaxSeekToPreviousPositionChanged(long))`(maxSeekToPreviousPositionMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Called when the value of[getMaxSeekToPreviousPosition](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getMaxSeekToPreviousPosition())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onMediaItemTransition](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onMediaItemTransition(androidx.media3.common.MediaItem,int))`(` ` mediaItem: `[MediaItem](https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem)`?,` ` @`[Player.MediaItemTransitionReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.MediaItemTransitionReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Called when playback transitions to a media item or starts repeating a media item according to the current[repeat mode](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getRepeatMode()).                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onMediaMetadataChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onMediaMetadataChanged(androidx.media3.common.MediaMetadata))`(mediaMetadata: `[MediaMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata)`!)` Called when the value of[getMediaMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getMediaMetadata())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onMetadata](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onMetadata(androidx.media3.common.Metadata))`(metadata: `[Metadata](https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata)`!)` Called when there is metadata associated with the current playback time.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPlayWhenReadyChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPlayWhenReadyChanged(boolean,int))`(` ` playWhenReady: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` @`[Player.PlayWhenReadyChangeReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PlayWhenReadyChangeReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Called when the value returned from[getPlayWhenReady](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlayWhenReady())changes.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPlaybackParametersChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPlaybackParametersChanged(androidx.media3.common.PlaybackParameters))`(playbackParameters: `[PlaybackParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackParameters)`!)` Called when the value of[getPlaybackParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaybackParameters())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPlaybackStateChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPlaybackStateChanged(int))`(@`[Player.State](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.State)` playbackState: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called when the value returned from[getPlaybackState](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaybackState())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPlaybackSuppressionReasonChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPlaybackSuppressionReasonChanged(int))`(` ` @`[Player.PlaybackSuppressionReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PlaybackSuppressionReason)` playbackSuppressionReason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Called when the value returned from[getPlaybackSuppressionReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaybackSuppressionReason())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPlayerError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPlayerError(androidx.media3.common.PlaybackException))`(error: `[PlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException)`!)` Called when an error occurs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPlayerErrorChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPlayerErrorChanged(androidx.media3.common.PlaybackException))`(error: `[PlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException)`?)` Called when the[PlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException)returned by[getPlayerError](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlayerError())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPlayerStateChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPlayerStateChanged(boolean,int))`(` ` playWhenReady: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`,` ` @`[Player.State](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.State)` playbackState: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` **This function is deprecated.** Use[onPlaybackStateChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlaybackStateChanged(int))and[onPlayWhenReadyChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayWhenReadyChanged(boolean,int))instead. <br />                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPlaylistMetadataChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPlaylistMetadataChanged(androidx.media3.common.MediaMetadata))`(playlistMetadata: `[MediaMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata)`!)` Called when the value of[getPlaylistMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaylistMetadata())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPositionDiscontinuity](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPositionDiscontinuity(int))`(@`[Player.DiscontinuityReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.DiscontinuityReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` **This function is deprecated.** Use[onPositionDiscontinuity](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPositionDiscontinuity(androidx.media3.common.Player.PositionInfo,androidx.media3.common.Player.PositionInfo,int))instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPositionDiscontinuity](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onPositionDiscontinuity(androidx.media3.common.Player.PositionInfo,androidx.media3.common.Player.PositionInfo,int))`(` ` oldPosition: `[Player.PositionInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PositionInfo)`!,` ` newPosition: `[Player.PositionInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PositionInfo)`!,` ` @`[Player.DiscontinuityReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.DiscontinuityReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Called when a position discontinuity occurs.                                                                                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onRenderedFirstFrame](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onRenderedFirstFrame())`()` 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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onRenderedFirstFrame](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onRenderedFirstFrame(java.lang.Object,long))`(output: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!, renderTimeMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onRendererReadyChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onRendererReadyChanged(int,int,boolean))`(` ` rendererIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` @`[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)` rendererTrackType: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` isRendererReady: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) `)` Called each time a renderer starts or stops allowing playback to be ready.                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onRepeatModeChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onRepeatModeChanged(int))`(@`[Player.RepeatMode](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.RepeatMode)` repeatMode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called when the value of[getRepeatMode](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getRepeatMode())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onSeekBackIncrementChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onSeekBackIncrementChanged(long))`(seekBackIncrementMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Called when the value of[getSeekBackIncrement](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getSeekBackIncrement())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onSeekForwardIncrementChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onSeekForwardIncrementChanged(long))`(seekForwardIncrementMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Called when the value of[getSeekForwardIncrement](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getSeekForwardIncrement())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onShuffleModeEnabledChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onShuffleModeEnabledChanged(boolean))`(shuffleModeEnabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when the value of[getShuffleModeEnabled](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getShuffleModeEnabled())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onSkipSilenceEnabledChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onSkipSilenceEnabledChanged(boolean))`(skipSilenceEnabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when skipping silences is enabled or disabled in the audio stream.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onSurfaceSizeChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onSurfaceSizeChanged(int,int))`(width: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, height: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called each time there's a change in the size of the surface onto which the video is being rendered.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onTimelineChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onTimelineChanged(androidx.media3.common.Timeline,int))`(` ` timeline: `[Timeline](https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline)`!,` ` @`[Player.TimelineChangeReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.TimelineChangeReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Called when the value of[getCurrentTimeline](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentTimeline())changes.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onTrackSelectionParametersChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onTrackSelectionParametersChanged(androidx.media3.common.TrackSelectionParameters))`(parameters: `[TrackSelectionParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters)`!)` Called when the value returned from[getTrackSelectionParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getTrackSelectionParameters())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onTracksChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onTracksChanged(androidx.media3.common.Tracks))`(tracks: `[Tracks](https://developer.android.com/reference/kotlin/androidx/media3/common/Tracks)`!)` Called when the value of[getCurrentTracks](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentTracks())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onUpstreamDiscarded](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onUpstreamDiscarded(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.MediaLoadData))`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?,` ` mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVideoCodecError](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVideoCodecError(java.lang.Exception))`(videoCodecError: `[Exception](https://developer.android.com/reference/java/lang/Exception.html)`!)` Called when a video decoder encounters an error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVideoDecoderInitialized](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVideoDecoderInitialized(java.lang.String,long,long))`(` ` decoderName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` initializedTimestampMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` initializationDurationMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)` Called when a video decoder is created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVideoDecoderReleased](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVideoDecoderReleased(java.lang.String))`(decoderName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Called when a video decoder is released.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVideoDisabled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVideoDisabled(androidx.media3.exoplayer.DecoderCounters))`(counters: `[DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)`!)` Called when the video renderer is disabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVideoEnabled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVideoEnabled(androidx.media3.exoplayer.DecoderCounters))`(counters: `[DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)`!)` Called when the video renderer is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVideoFrameProcessingOffset](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVideoFrameProcessingOffset(long,int))`(` ` totalProcessingOffsetUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` frameCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Called to report the video processing offset of video frames processed by the video renderer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVideoInputFormatChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVideoInputFormatChanged(androidx.media3.common.Format,androidx.media3.exoplayer.DecoderReuseEvaluation))`(` ` format: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!,` ` decoderReuseEvaluation: `[DecoderReuseEvaluation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation)`?` `)` Called when the format of the media being consumed by the video renderer changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVideoSizeChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVideoSizeChanged(androidx.media3.common.VideoSize))`(videoSize: `[VideoSize](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoSize)`!)` Called each time when[getVideoSize](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getVideoSize())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onVolumeChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#onVolumeChanged(float))`(volume: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Called when the value of[getVolume](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getVolume())changes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | `@`[CallSuper](https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper) [release](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#release())`()` Releases the collector.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | `@`[CallSuper](https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper) [removeListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#removeListener(androidx.media3.exoplayer.analytics.AnalyticsListener))`(listener: `[AnalyticsListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener)`!)` Removes a previously added analytics event listener.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | `@`[CallSuper](https://developer.android.com/reference/kotlin/androidx/annotation/CallSuper) [setPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#setPlayer(androidx.media3.common.Player,android.os.Looper))`(player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!, looper: `[Looper](https://developer.android.com/reference/android/os/Looper.html)`!)` Sets the player for which data will be collected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | ~~[setThrowsWhenUsingWrongThread](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#setThrowsWhenUsingWrongThread(boolean))~~`(throwsWhenUsingWrongThread: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` **This function is deprecated.** Do not use this method and ensure all calls are made from the correct thread. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [updateMediaPeriodQueueInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#updateMediaPeriodQueueInfo(java.util.List<androidx.media3.exoplayer.source.MediaSource.MediaPeriodId>,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))`(` ` queue: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`!>!,` ` readingPeriod: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` `)` Updates the playback queue information used for event association.                                                                                                                                                                                                     |

|                                                             ### Protected functions                                                              |
|--------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AnalyticsListener.EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)`!` | [generateCurrentPlayerMediaPeriodEventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#generateCurrentPlayerMediaPeriodEventTime())`()` Generates an[EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)for the currently playing item in the player.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [AnalyticsListener.EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)`!` | `@`[RequiresNonNull](https://checkerframework.org/api/org/checkerframework/checker/nullness/qual/RequiresNonNull.html)`(value = "player")` [generateEventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#generateEventTime(androidx.media3.common.Timeline,int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))`(` ` timeline: `[Timeline](https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline)`!,` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` `)` Returns a new[EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)for the specified timeline, window and media period id. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                    | [sendEvent](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#sendEvent(androidx.media3.exoplayer.analytics.AnalyticsListener.EventTime,int,androidx.media3.common.util.ListenerSet.Event<androidx.media3.exoplayer.analytics.AnalyticsListener>))`(` ` eventTime: `[AnalyticsListener.EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)`!,` ` eventFlag: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` eventInvocation: `[ListenerSet.Event](https://developer.android.com/reference/kotlin/androidx/media3/common/util/ListenerSet.Event)`<`[AnalyticsListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener)`!>!` `)` Sends an event to registered listeners.                                                                             |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.media3.exoplayer.drm.DrmSessionEventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener) |-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | ~~[onDrmKeysLoaded](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener#onDrmKeysLoaded(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId))~~`(` ` windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` `)` **This function is deprecated.** Implement[onDrmKeysLoaded](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionEventListener#onDrmKeysLoaded(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.drm.KeyRequestInfo))instead <br /> | |

## Public constructors

### DefaultAnalyticsCollector

```
DefaultAnalyticsCollector(clock: Clock!)
```

Creates an analytics collector.  

|                                              Parameters                                               |
|-------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| `clock: `[Clock](https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock)`!` | A[Clock](https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock)used to generate timestamps. |

## Public functions

### addListener

```
@CallSuper
fun addListener(listener: AnalyticsListener!): Unit
```

Adds a listener for analytics events.  

|                                                                Parameters                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
| `listener: `[AnalyticsListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener)`!` | The listener to add. |

### notifySeekStarted

```
fun notifySeekStarted(): Unit
```

Notifies the analytics collector that a seek operation will start. Should be called before the player adjusts its state and position to the seek.  

### onAudioAttributesChanged

```
fun onAudioAttributesChanged(audioAttributes: AudioAttributes!): Unit
```

Called when the value of[getAudioAttributes](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getAudioAttributes())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                           Parameters                                                           |
|--------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| `audioAttributes: `[AudioAttributes](https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes)`!` | The audio attributes. |

### onAudioCodecError

```
fun onAudioCodecError(audioCodecError: Exception!): Unit
```

Called when an audio decoder encounters an error.  

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `audioCodecError: `[Exception](https://developer.android.com/reference/java/lang/Exception.html)`!` | The error. Typically a[CodecException](https://developer.android.com/reference/android/media/MediaCodec.CodecException.html)if the renderer uses[MediaCodec](https://developer.android.com/reference/android/media/MediaCodec.html), or a[DecoderException](https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderException)if the renderer uses a software decoder. |

### onAudioDecoderInitialized

```
fun onAudioDecoderInitialized(
    decoderName: String!,
    initializedTimestampMs: Long,
    initializationDurationMs: Long
): Unit
```

Called when a audio decoder is created.  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `decoderName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`       | The audio decoder that was created.                                                                                                   |
| `initializedTimestampMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)   | [elapsedRealtime](https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime())when initialization finished. |
| `initializationDurationMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The time taken to initialize the decoder in milliseconds.                                                                             |

### onAudioDecoderReleased

```
fun onAudioDecoderReleased(decoderName: String!): Unit
```

Called when a audio decoder is released.  

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|--------------------------------------|
| `decoderName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The audio decoder that was released. |

### onAudioDisabled

```
fun onAudioDisabled(counters: DecoderCounters!): Unit
```

Called when the audio renderer is disabled.  

|                                                         Parameters                                                         |
|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `counters: `[DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)`!` | [DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)that were updated by the audio renderer. |

### onAudioEnabled

```
fun onAudioEnabled(counters: DecoderCounters!): Unit
```

Called when the audio renderer is enabled.  

|                                                         Parameters                                                         |
|----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `counters: `[DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)`!` | [DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)that will be updated by the audio renderer for as long as it remains enabled. |

### onAudioInputFormatChanged

```
fun onAudioInputFormatChanged(
    format: Format!,
    decoderReuseEvaluation: DecoderReuseEvaluation?
): Unit
```

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

|                                                                       Parameters                                                                       |
|--------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `format: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!`                                                    | The new format.                                                                                                                                                  |
| `decoderReuseEvaluation: `[DecoderReuseEvaluation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/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. |

### onAudioPositionAdvancing

```
fun onAudioPositionAdvancing(playoutStartSystemTimeMs: Long): Unit
```

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

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| `playoutStartSystemTimeMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The approximate derived[currentTimeMillis](https://developer.android.com/reference/java/lang/System.html#currentTimeMillis())at which playout started. |

### onAudioSessionIdChanged

```
fun onAudioSessionIdChanged(audioSessionId: Int): Unit
```

Called when the audio session ID changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|-----------------------|
| `audioSessionId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The audio session ID. |

### onAudioSinkError

```
fun onAudioSinkError(audioSinkError: Exception!): Unit
```

Called when[AudioSink](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink)has encountered an error.

If the sink writes to a platform[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html), this will be called for all[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html)errors.  

|                                             Parameters                                             |
|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `audioSinkError: `[Exception](https://developer.android.com/reference/java/lang/Exception.html)`!` | The error that occurred. Typically an[AudioSink.InitializationException](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.InitializationException), a[AudioSink.WriteException](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.WriteException), or an[AudioSink.UnexpectedDiscontinuityException](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.UnexpectedDiscontinuityException). |

### onAudioTrackInitialized

```
fun onAudioTrackInitialized(audioTrackConfig: AudioSink.AudioTrackConfig!): Unit
```

Called when an[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html)has been initialized.  

|                                                                           Parameters                                                                           |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `audioTrackConfig: `[AudioSink.AudioTrackConfig](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.AudioTrackConfig)`!` | The[AudioSink.AudioTrackConfig](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.AudioTrackConfig)of the initialized[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html). |

### onAudioTrackReleased

```
fun onAudioTrackReleased(audioTrackConfig: AudioSink.AudioTrackConfig!): Unit
```

Called when an[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html)has been released.  

|                                                                           Parameters                                                                           |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `audioTrackConfig: `[AudioSink.AudioTrackConfig](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.AudioTrackConfig)`!` | The[AudioSink.AudioTrackConfig](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.AudioTrackConfig)of the released[AudioTrack](https://developer.android.com/reference/android/media/AudioTrack.html). |

### onAudioUnderrun

```
fun onAudioUnderrun(
    bufferSize: Int,
    bufferSizeMs: Long,
    elapsedSinceLastFeedMs: Long
): Unit
```

Called when an audio underrun occurs.  

|                                               Parameters                                                |
|---------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `bufferSize: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)               | The size of the audio output buffer, in bytes.                                                                                                                                                                                                |
| `bufferSizeMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)           | The size of the audio output buffer, in milliseconds, if it contains PCM encoded audio.[TIME_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET())if the output buffer contains non-PCM encoded audio. |
| `elapsedSinceLastFeedMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The time since audio was last written to the output buffer.                                                                                                                                                                                   |

### onAvailableCommandsChanged

```
fun onAvailableCommandsChanged(availableCommands: Player.Commands!): Unit
```

Called when the value returned from[isCommandAvailable](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#isCommandAvailable(int))changes for at least one[Command](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Command).

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                            Parameters                                                            |
|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| `availableCommands: `[Player.Commands](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands)`!` | The available[Commands](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Commands). |

### onBandwidthSample

```
fun onBandwidthSample(
    elapsedMs: Int,
    bytesTransferred: Long,
    bitrateEstimate: Long
): Unit
```

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`.  

|                                            Parameters                                             |
|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `elapsedMs: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)          | 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: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The number of bytes transferred since the last callback.                                                                                                                                                    |
| `bitrateEstimate: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)  | The estimated bitrate in bits/sec.                                                                                                                                                                          |

### onCues

```
fun onCues(cueGroup: CueGroup!): Unit
```

Called when the value of[getCurrentCues](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentCues())changes.

Both this method and[onCues](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onCues(java.util.List<androidx.media3.common.text.Cue>))are called when there is a change in the cues. You should only implement one or the other.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

### onCues

```
fun onCues(cues: (Mutable)List<Cue!>!): Unit
```
| **This function is deprecated.**   
|
| Use[onCues](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onCues(androidx.media3.common.text.CueGroup))instead.

Called when the value of[getCurrentCues](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentCues())changes.

Both this method and[onCues](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onCues(androidx.media3.common.text.CueGroup))are called when there is a change in the cues. You should only implement one or the other.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

### onDeviceInfoChanged

```
fun onDeviceInfoChanged(deviceInfo: DeviceInfo!): Unit
```

Called when the device information changes

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                   Parameters                                                    |
|-----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| `deviceInfo: `[DeviceInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo)`!` | The new[DeviceInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/DeviceInfo). |

### onDeviceVolumeChanged

```
fun onDeviceVolumeChanged(volume: Int, muted: Boolean): Unit
```

Called when the value of[getDeviceVolume](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getDeviceVolume())or[isDeviceMuted](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#isDeviceMuted())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                          Parameters                                          |
|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------|
| `volume: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)        | The new device volume, with 0 being silence and 1 being unity gain. |
| `muted: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether the device is muted.                                        |

### onDownstreamFormatChanged

```
fun onDownstreamFormatChanged(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    mediaLoadData: MediaLoadData!
): Unit
```

Called when a downstream format change occurs (i.e. when the format of the media being read from one or more[SampleStream](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/SampleStream)s provided by the source changes).  

|                                                                         Parameters                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline of the media source this load belongs to.                                                                                    |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)the media belongs to.            |
| `mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!`                         | The[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)defining the newly selected downstream data. |

### onDrmKeysLoaded

```
fun onDrmKeysLoaded(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    keyRequestInfo: KeyRequestInfo!
): Unit
```

Called each time keys are loaded.  

|                                                                         Parameters                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline this media period belongs to.                                                                                                |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)associated with the drm session. |
| `keyRequestInfo: `[KeyRequestInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/KeyRequestInfo)`!`                         | The[KeyRequestInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/KeyRequestInfo)with load info for the drm server requests    |

### onDrmKeysRemoved

```
fun onDrmKeysRemoved(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Unit
```

Called each time offline keys are removed.  

|                                                                         Parameters                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline this media period belongs to.                                                                                                |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)associated with the drm session. |

### onDrmKeysRestored

```
fun onDrmKeysRestored(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Unit
```

Called each time offline keys are restored.  

|                                                                         Parameters                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline this media period belongs to.                                                                                                |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)associated with the drm session. |

### onDrmSessionAcquired

```
fun onDrmSessionAcquired(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    @DrmSession.State state: Int
): Unit
```

Called each time a drm session is acquired.  

|                                                                                                Parameters                                                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                | The window index in the timeline this media period belongs to.                                                                                                     |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?`                                                | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)associated with the drm session.      |
| `@`[DrmSession.State](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSession.State)` state: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[DrmSession.State](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSession.State)of the session when the acquisition completed. |

### onDrmSessionManagerError

```
fun onDrmSessionManagerError(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    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 and continue. Hence applications should*not* implement this method to display a user visible error or initiate an application level retry ([onPlayerError](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayerError(androidx.media3.common.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                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline this media period belongs to.                                                                                                |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)associated with the drm session. |
| `error: `[Exception](https://developer.android.com/reference/java/lang/Exception.html)`!`                                                                  | The corresponding exception.                                                                                                                                  |

### onDrmSessionReleased

```
fun onDrmSessionReleased(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): Unit
```

Called each time a drm session is released.  

|                                                                         Parameters                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline this media period belongs to.                                                                                                |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)associated with the drm session. |

### onDroppedFrames

```
fun onDroppedFrames(count: Int, elapsedMs: Long): Unit
```

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.  

|                                         Parameters                                         |
|--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `count: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)       | The number of dropped frames.                                                                                                                                                                                                                                      |
| `elapsedMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | 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. |

### onDroppedSeeksWhileScrubbing

```
fun onDroppedSeeksWhileScrubbing(droppedSeekCount: Int): Unit
```

Called when seeks are dropped when scrubbing.  

|                                           Parameters                                            |
|-------------------------------------------------------------------------------------------------|------------------------------|
| `droppedSeekCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The number of dropped seeks. |

### onEvents

```
fun onEvents(player: Player!, events: Player.Events!): Unit
```

Called when one or more player states changed.

State changes and events that happen within one[Looper](https://developer.android.com/reference/android/os/Looper.html)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[onPlaybackStateChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlaybackStateChanged(int))and[onPlayWhenReadyChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayWhenReadyChanged(boolean,int))).
- They need access to the[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)object to trigger further events (e.g. to call[seekTo](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekTo(long))after a[onMediaItemTransition](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onMediaItemTransition(androidx.media3.common.MediaItem,int))).
- They intend to use multiple state values together or in combination with[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)getter methods. For example using[getCurrentMediaItemIndex](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentMediaItemIndex())with the`
  timeline`provided in[onTimelineChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onTimelineChanged(androidx.media3.common.Timeline,int))is only safe from within this method.
- They are interested in events that logically happened together (e.g[onPlaybackStateChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlaybackStateChanged(int))to[STATE_BUFFERING](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_BUFFERING())because of[onMediaItemTransition](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onMediaItemTransition(androidx.media3.common.MediaItem,int))).

|                                                    Parameters                                                     |
|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!`               | The[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)whose state changed. Use the getters to obtain the latest states.               |
| `events: `[Player.Events](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events)`!` | The[Events](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Events)that happened in this iteration, indicating which player states changed. |

### onIsLoadingChanged

```
fun onIsLoadingChanged(isLoading: Boolean): Unit
```

Called when the player starts or stops loading the source.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|-----------------------------------------------|
| `isLoading: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether the source is currently being loaded. |

### onIsPlayingChanged

```
fun onIsPlayingChanged(isPlaying: Boolean): Unit
```

Called when the value of[isPlaying](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#isPlaying())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|--------------------------------|
| `isPlaying: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether the player is playing. |

### onLoadCanceled

```
fun onLoadCanceled(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!
): Unit
```

Called when a load is canceled.  

|                                                                         Parameters                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline of the media source this load belongs to.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)this load belongs to. Null if the load does not belong to a specific media period.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loadEventInfo: `[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)`!`                         | The[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)corresponding to the event. The values of[elapsedRealtimeMs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo#elapsedRealtimeMs())and[bytesLoaded](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo#bytesLoaded())are relative to the corresponding[onLoadStarted](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener#onLoadStarted(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.source.MediaLoadData,int))event. |
| `mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!`                         | The[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)defining the data being loaded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

### onLoadCompleted

```
fun onLoadCompleted(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!
): Unit
```

Called when a load ends.  

|                                                                         Parameters                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline of the media source this load belongs to.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)this load belongs to. Null if the load does not belong to a specific media period.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loadEventInfo: `[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)`!`                         | The[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)corresponding to the event. The values of[elapsedRealtimeMs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo#elapsedRealtimeMs())and[bytesLoaded](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo#bytesLoaded())are relative to the corresponding[onLoadStarted](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener#onLoadStarted(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.source.MediaLoadData,int))event. |
| `mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!`                         | The[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)defining the data being loaded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

### onLoadError

```
fun onLoadError(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!,
    error: IOException!,
    wasCanceled: Boolean
): Unit
```

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,[onLoadCanceled](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener#onLoadCanceled(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.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.[onPlayerError](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayerError(androidx.media3.common.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                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline of the media source this load belongs to.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)this load belongs to. Null if the load does not belong to a specific media period.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `loadEventInfo: `[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)`!`                         | The[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)corresponding to the event. The values of[elapsedRealtimeMs](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo#elapsedRealtimeMs())and[bytesLoaded](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo#bytesLoaded())are relative to the corresponding[onLoadStarted](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener#onLoadStarted(int,androidx.media3.exoplayer.source.MediaSource.MediaPeriodId,androidx.media3.exoplayer.source.LoadEventInfo,androidx.media3.exoplayer.source.MediaLoadData,int))event. |
| `mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!`                         | The[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)defining the data being loaded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `error: `[IOException](https://developer.android.com/reference/java/io/IOException.html)`!`                                                                | The load error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `wasCanceled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                         | Whether the load was canceled as a result of the error.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

### onLoadStarted

```
fun onLoadStarted(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!,
    retryCount: Int
): Unit
```

Called when a load begins.  

|                                                                         Parameters                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline of the media source this load belongs to.                                                                                                                                                                                                                                                                                                                                                                                     |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)this load belongs to. Null if the load does not belong to a specific media period.                                                                                                                                                                                                                                                |
| `loadEventInfo: `[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)`!`                         | The[LoadEventInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo)corresponding to the event. The value of[uri](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo#uri())won't reflect potential redirection yet and[responseHeaders](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/LoadEventInfo#responseHeaders())will be empty. |
| `mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!`                         | The[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)defining the data being loaded.                                                                                                                                                                                                                                                                                                               |
| `retryCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                  | The number of failed attempts since this method was first called (this is zero for the first load attempt).                                                                                                                                                                                                                                                                                                                                                    |

### onLoadingChanged

```
fun onLoadingChanged(isLoading: Boolean): Unit
```
| **This function is deprecated.**   
|
Use[onIsLoadingChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onIsLoadingChanged(boolean))instead.  

### onMaxSeekToPreviousPositionChanged

```
fun onMaxSeekToPreviousPositionChanged(maxSeekToPreviousPositionMs: Long): Unit
```

Called when the value of[getMaxSeekToPreviousPosition](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getMaxSeekToPreviousPosition())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                  Parameters                                                  |
|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `maxSeekToPreviousPositionMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The maximum position for which[seekToPrevious](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekToPrevious())seeks to the previous position, in milliseconds. |

### onMediaItemTransition

```
fun onMediaItemTransition(
    mediaItem: MediaItem?,
    @Player.MediaItemTransitionReason reason: Int
): Unit
```

Called when playback transitions to a media item or starts repeating a media item according to the current[repeat mode](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getRepeatMode()).

Note that this callback is also called when the value of[getCurrentTimeline](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentTimeline())becomes non-empty or empty.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                                                                             Parameters                                                                                                              |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `mediaItem: `[MediaItem](https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem)`?`                                                                                                                        | The[MediaItem](https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem). May be null if the playlist becomes empty. |
| `@`[Player.MediaItemTransitionReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.MediaItemTransitionReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The reason for the transition.                                                                                                              |

### onMediaMetadataChanged

```
fun onMediaMetadataChanged(mediaMetadata: MediaMetadata!): Unit
```

Called when the value of[getMediaMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getMediaMetadata())changes.

This method may be called multiple times in quick succession.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                        Parameters                                                        |
|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| `mediaMetadata: `[MediaMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata)`!` | The combined[MediaMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/MediaMetadata). |

### onMetadata

```
fun onMetadata(metadata: Metadata!): Unit
```

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

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|---------------|
| `metadata: `[Metadata](https://developer.android.com/reference/kotlin/androidx/media3/common/Metadata)`!` | The metadata. |

### onPlayWhenReadyChanged

```
fun onPlayWhenReadyChanged(
    playWhenReady: Boolean,
    @Player.PlayWhenReadyChangeReason reason: Int
): Unit
```

Called when the value returned from[getPlayWhenReady](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlayWhenReady())changes.

The current`playWhenReady`value may be re-reported if the`reason`for this value changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                                                                             Parameters                                                                                                              |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
| `playWhenReady: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                                                | Whether playback will proceed when ready.                                                                                                             |
| `@`[Player.PlayWhenReadyChangeReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PlayWhenReadyChangeReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[PlayWhenReadyChangeReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PlayWhenReadyChangeReason)for the change. |

### onPlaybackParametersChanged

```
fun onPlaybackParametersChanged(playbackParameters: PlaybackParameters!): Unit
```

Called when the value of[getPlaybackParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaybackParameters())changes. The playback parameters may change due to a call to[setPlaybackParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#setPlaybackParameters(androidx.media3.common.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).

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                               Parameters                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------|--------------------------|
| `playbackParameters: `[PlaybackParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackParameters)`!` | The playback parameters. |

### onPlaybackStateChanged

```
fun onPlaybackStateChanged(@Player.State playbackState: Int): Unit
```

Called when the value returned from[getPlaybackState](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaybackState())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                                                             Parameters                                                                                             |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|
| `@`[Player.State](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.State)` playbackState: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The new playback[State](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.State). |

### onPlaybackSuppressionReasonChanged

```
fun onPlaybackSuppressionReasonChanged(
    @Player.PlaybackSuppressionReason playbackSuppressionReason: Int
): Unit
```

Called when the value returned from[getPlaybackSuppressionReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaybackSuppressionReason())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                                                                                       Parameters                                                                                                                       |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `@`[Player.PlaybackSuppressionReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PlaybackSuppressionReason)` playbackSuppressionReason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The current[PlaybackSuppressionReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PlaybackSuppressionReason). |

### onPlayerError

```
fun onPlayerError(error: PlaybackException!): Unit
```

Called when an error occurs. The playback state will transition to[STATE_IDLE](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#STATE_IDLE())immediately after this method is called. The player instance can still be used, and[release](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#release())must still be called on the player should it no longer be required.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.

Implementations of Player may pass an instance of a subclass of[PlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException)to this method in order to include more information about the error.  

|                                                        Parameters                                                        |
|--------------------------------------------------------------------------------------------------------------------------|------------|
| `error: `[PlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException)`!` | The error. |

### onPlayerErrorChanged

```
fun onPlayerErrorChanged(error: PlaybackException?): Unit
```

Called when the[PlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException)returned by[getPlayerError](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlayerError())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.

Implementations of Player may pass an instance of a subclass of[PlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException)to this method in order to include more information about the error.  

|                                                        Parameters                                                        |
|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|
| `error: `[PlaybackException](https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackException)`?` | The new error, or null if the error is being cleared. |

### onPlayerStateChanged

```
fun onPlayerStateChanged(
    playWhenReady: Boolean,
    @Player.State playbackState: Int
): Unit
```
| **This function is deprecated.**   
|
Use[onPlaybackStateChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlaybackStateChanged(int))and[onPlayWhenReadyChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayWhenReadyChanged(boolean,int))instead.  

### onPlaylistMetadataChanged

```
fun onPlaylistMetadataChanged(playlistMetadata: MediaMetadata!): Unit
```

Called when the value of[getPlaylistMetadata](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getPlaylistMetadata())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

### onPositionDiscontinuity

```
fun onPositionDiscontinuity(@Player.DiscontinuityReason reason: Int): Unit
```
| **This function is deprecated.**   
|
Use[onPositionDiscontinuity](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPositionDiscontinuity(androidx.media3.common.Player.PositionInfo,androidx.media3.common.Player.PositionInfo,int))instead.  

### onPositionDiscontinuity

```
fun onPositionDiscontinuity(
    oldPosition: Player.PositionInfo!,
    newPosition: Player.PositionInfo!,
    @Player.DiscontinuityReason reason: Int
): Unit
```

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.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                                                                       Parameters                                                                                                        |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `oldPosition: `[Player.PositionInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PositionInfo)`!`                                                                                      | The position before the discontinuity.                                                                                                                       |
| `newPosition: `[Player.PositionInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.PositionInfo)`!`                                                                                      | The position after the discontinuity.                                                                                                                        |
| `@`[Player.DiscontinuityReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.DiscontinuityReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[DiscontinuityReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.DiscontinuityReason)responsible for the discontinuity. |

### onRenderedFirstFrame

```
fun onRenderedFirstFrame(): 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.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

### onRenderedFirstFrame

```
fun onRenderedFirstFrame(output: Any!, renderTimeMs: Long): Unit
```

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.  

|                                          Parameters                                           |
|-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `output: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!`      | The output of the video renderer. Normally a[Surface](https://developer.android.com/reference/android/view/Surface.html), however some video renderers may have other output types (e.g., a[VideoDecoderOutputBufferRenderer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/VideoDecoderOutputBufferRenderer)). |
| `renderTimeMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The[elapsedRealtime](https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime())when the frame was rendered.                                                                                                                                                                                                          |

### onRendererReadyChanged

```
fun onRendererReadyChanged(
    rendererIndex: Int,
    @C.TrackType rendererTrackType: Int,
    isRendererReady: Boolean
): Unit
```

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

|                                                                                              Parameters                                                                                              |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `rendererIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                         | The index of the renderer in the[androidx.media3.exoplayer.ExoPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer)instance. |
| `@`[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)` rendererTrackType: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)of the renderer.                                                |
| `isRendererReady: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                               | Whether the renderer allows playback to be ready.                                                                                                                  |

### onRepeatModeChanged

```
fun onRepeatModeChanged(@Player.RepeatMode repeatMode: Int): Unit
```

Called when the value of[getRepeatMode](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getRepeatMode())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                                                                Parameters                                                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| `@`[Player.RepeatMode](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.RepeatMode)` repeatMode: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[RepeatMode](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.RepeatMode)used for playback. |

### onSeekBackIncrementChanged

```
fun onSeekBackIncrementChanged(seekBackIncrementMs: Long): Unit
```

Called when the value of[getSeekBackIncrement](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getSeekBackIncrement())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                              Parameters                                              |
|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `seekBackIncrementMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The[seekBack](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekBack())increment, in milliseconds. |

### onSeekForwardIncrementChanged

```
fun onSeekForwardIncrementChanged(seekForwardIncrementMs: Long): Unit
```

Called when the value of[getSeekForwardIncrement](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getSeekForwardIncrement())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                               Parameters                                                |
|---------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `seekForwardIncrementMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The[seekForward](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#seekForward())increment, in milliseconds. |

### onShuffleModeEnabledChanged

```
fun onShuffleModeEnabledChanged(shuffleModeEnabled: Boolean): Unit
```

Called when the value of[getShuffleModeEnabled](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getShuffleModeEnabled())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `shuffleModeEnabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether shuffling of[media items](https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem)is enabled. |

### onSkipSilenceEnabledChanged

```
fun onSkipSilenceEnabledChanged(skipSilenceEnabled: Boolean): Unit
```

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

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| `skipSilenceEnabled: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether skipping silences in the audio stream is enabled. |

### onSurfaceSizeChanged

```
fun onSurfaceSizeChanged(width: Int, height: Int): Unit
```

Called each time there's a change in the size of the surface onto which the video is being rendered.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                      Parameters                                       |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `width: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)  | The surface width in pixels. May be[LENGTH_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET())if unknown, or 0 if the video is not rendered onto a surface.  |
| `height: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The surface height in pixels. May be[LENGTH_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET())if unknown, or 0 if the video is not rendered onto a surface. |

### onTimelineChanged

```
fun onTimelineChanged(
    timeline: Timeline!,
    @Player.TimelineChangeReason reason: Int
): Unit
```

Called when the value of[getCurrentTimeline](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentTimeline())changes.

Note that the current[MediaItem](https://developer.android.com/reference/kotlin/androidx/media3/common/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[onPositionDiscontinuity](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPositionDiscontinuity(androidx.media3.common.Player.PositionInfo,androidx.media3.common.Player.PositionInfo,int))callback will be triggered.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                                                                        Parameters                                                                                                         |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `timeline: `[Timeline](https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline)`!`                                                                                                                 | The latest timeline. Never null, but may be empty.                                                                                                                |
| `@`[Player.TimelineChangeReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.TimelineChangeReason)` reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[TimelineChangeReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.TimelineChangeReason)responsible for this timeline change. |

### onTrackSelectionParametersChanged

```
fun onTrackSelectionParametersChanged(parameters: TrackSelectionParameters!): Unit
```

Called when the value returned from[getTrackSelectionParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getTrackSelectionParameters())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                                 Parameters                                                                  |
|---------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| `parameters: `[TrackSelectionParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters)`!` | The new[TrackSelectionParameters](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters). |

### onTracksChanged

```
fun onTracksChanged(tracks: Tracks!): Unit
```

Called when the value of[getCurrentTracks](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getCurrentTracks())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
| `tracks: `[Tracks](https://developer.android.com/reference/kotlin/androidx/media3/common/Tracks)`!` | The available tracks information. Never null, but may be of length zero. |

### onUpstreamDiscarded

```
fun onUpstreamDiscarded(
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?,
    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                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `windowIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                 | The window index in the timeline of the media source this load belongs to.                                                                           |
| `mediaPeriodId: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?` | The[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)the media belongs to.   |
| `mediaLoadData: `[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)`!`                         | The[MediaLoadData](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaLoadData)defining the media being discarded. |

### onVideoCodecError

```
fun onVideoCodecError(videoCodecError: Exception!): Unit
```

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.[onPlayerError](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onPlayerError(androidx.media3.common.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                                              |
|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `videoCodecError: `[Exception](https://developer.android.com/reference/java/lang/Exception.html)`!` | The error. Typically a[CodecException](https://developer.android.com/reference/android/media/MediaCodec.CodecException.html)if the renderer uses[MediaCodec](https://developer.android.com/reference/android/media/MediaCodec.html), or a[DecoderException](https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderException)if the renderer uses a software decoder. |

### onVideoDecoderInitialized

```
fun onVideoDecoderInitialized(
    decoderName: String!,
    initializedTimestampMs: Long,
    initializationDurationMs: Long
): Unit
```

Called when a video decoder is created.  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `decoderName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`       | The decoder that was created.                                                                                                         |
| `initializedTimestampMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)   | [elapsedRealtime](https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime())when initialization finished. |
| `initializationDurationMs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The time taken to initialize the decoder in milliseconds.                                                                             |

### onVideoDecoderReleased

```
fun onVideoDecoderReleased(decoderName: String!): Unit
```

Called when a video decoder is released.  

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|--------------------------------------|
| `decoderName: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | The video decoder that was released. |

### onVideoDisabled

```
fun onVideoDisabled(counters: DecoderCounters!): Unit
```

Called when the video renderer is disabled.  

|                                                         Parameters                                                         |
|----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `counters: `[DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)`!` | [DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)that were updated by the video renderer. |

### onVideoEnabled

```
fun onVideoEnabled(counters: DecoderCounters!): Unit
```

Called when the video renderer is enabled.  

|                                                         Parameters                                                         |
|----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `counters: `[DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)`!` | [DecoderCounters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters)that will be updated by the video renderer for as long as it remains enabled. |

### onVideoFrameProcessingOffset

```
fun onVideoFrameProcessingOffset(
    totalProcessingOffsetUs: Long,
    frameCount: Int
): Unit
```

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.  

|                                                Parameters                                                |
|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
| `totalProcessingOffsetUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The sum of all video frame processing offset samples for the video frames processed by the renderer in microseconds. |
| `frameCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                | The number of samples included in the`totalProcessingOffsetUs`.                                                      |

### onVideoInputFormatChanged

```
fun onVideoInputFormatChanged(
    format: Format!,
    decoderReuseEvaluation: DecoderReuseEvaluation?
): Unit
```

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

|                                                                       Parameters                                                                       |
|--------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `format: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!`                                                    | The new format.                                                                                                                                                  |
| `decoderReuseEvaluation: `[DecoderReuseEvaluation](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/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

```
fun onVideoSizeChanged(videoSize: VideoSize!): Unit
```

Called each time when[getVideoSize](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getVideoSize())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                                  Parameters                                                  |
|--------------------------------------------------------------------------------------------------------------|----------------------------|
| `videoSize: `[VideoSize](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoSize)`!` | The new size of the video. |

### onVolumeChanged

```
fun onVolumeChanged(volume: Float): Unit
```

Called when the value of[getVolume](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#getVolume())changes.

[onEvents](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onEvents(androidx.media3.common.Player,androidx.media3.common.Player.Events))will also be called to report this event along with other events that happen in the same[Looper](https://developer.android.com/reference/android/os/Looper.html)message queue iteration.  

|                                        Parameters                                         |
|-------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `volume: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The new volume, with 0 being silence and 1 being unity gain. |

### release

```
@CallSuper
fun release(): Unit
```

Releases the collector. Must be called after the player for which data is collected has been released.  

### removeListener

```
@CallSuper
fun removeListener(listener: AnalyticsListener!): Unit
```

Removes a previously added analytics event listener.  

|                                                                Parameters                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `listener: `[AnalyticsListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener)`!` | The listener to remove. |

### setPlayer

```
@CallSuper
fun setPlayer(player: Player!, looper: Looper!): Unit
```

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.  

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
| `player: `[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)`!` | The[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)for which data will be collected. |
| `looper: `[Looper](https://developer.android.com/reference/android/os/Looper.html)`!`               | The[Looper](https://developer.android.com/reference/android/os/Looper.html)used for listener callbacks.                    |

### setThrowsWhenUsingWrongThread

```
fun [setThrowsWhenUsingWrongThread](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/DefaultAnalyticsCollector#setThrowsWhenUsingWrongThread(boolean))(throwsWhenUsingWrongThread: Boolean): Unit
```
| **This function is 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: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether to throw when using the wrong thread. |

### updateMediaPeriodQueueInfo

```
fun updateMediaPeriodQueueInfo(
    queue: (Mutable)List<MediaSource.MediaPeriodId!>!,
    readingPeriod: MediaSource.MediaPeriodId?
): Unit
```

Updates the playback queue information used for event association.

Should only be called by the player controlling the queue and not from app code.  

|                                                                                                                                                                        Parameters                                                                                                                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `queue: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`!>!` | The playback queue of media periods identified by their[MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId). |
| `readingPeriod: `[MediaSource.MediaPeriodId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.MediaPeriodId)`?`                                                                                                                                                                                               | The media period in the queue that is currently being read by renderers, or null if the queue is empty.                                                                            |

## Protected functions

### generateCurrentPlayerMediaPeriodEventTime

```
protected fun generateCurrentPlayerMediaPeriodEventTime(): AnalyticsListener.EventTime!
```

Generates an[EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)for the currently playing item in the player.  

### generateEventTime

```
@RequiresNonNull(value = "player")
protected fun generateEventTime(
    timeline: Timeline!,
    windowIndex: Int,
    mediaPeriodId: MediaSource.MediaPeriodId?
): AnalyticsListener.EventTime!
```

Returns a new[EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)for the specified timeline, window and media period id.  

### sendEvent

```
protected fun sendEvent(
    eventTime: AnalyticsListener.EventTime!,
    eventFlag: Int,
    eventInvocation: ListenerSet.Event<AnalyticsListener!>!
): Unit
```

Sends an event to registered listeners.  

|                                                                                                                              Parameters                                                                                                                               |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `eventTime: `[AnalyticsListener.EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)`!`                                                                                                         | The[EventTime](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener.EventTime)to report.                                                   |
| `eventFlag: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                                              | An integer flag indicating the type of the event, or[INDEX_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET())to report this event without flag. |
| `eventInvocation: `[ListenerSet.Event](https://developer.android.com/reference/kotlin/androidx/media3/common/util/ListenerSet.Event)`<`[AnalyticsListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/AnalyticsListener)`!>!` | The event.                                                                                                                                                                                 |