# PlaybackStats

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/PlaybackStats.java+class:androidx.media3.exoplayer.analytics.PlaybackStats)

*** ** * ** ***

<br />

```
@UnstableApi
class PlaybackStats
```

<br />

*** ** * ** ***

Statistics about playbacks.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndException` Stores an exception with the event time at which it occurred. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndFormat` Stores a format with the event time at which it started being used, or `null` to indicate that no format was used. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndPlaybackState` Stores a playback state with the event time at which it became active. |

| ### Constants |
|---|---|
| `const https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#EMPTY()` Empty playback stats. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_ABANDONED() = 15` Playback is abandoned before reaching the end of the media. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_BUFFERING() = 6` Playback is buffering to resume active playback. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_ENDED() = 11` Playback has reached the end of the media. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_FAILED() = 13` Playback is stopped due a fatal error and can be retried. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_INTERRUPTED_BY_AD() = 14` Playback is interrupted by an ad. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_JOINING_BACKGROUND() = 1` Playback is buffering in the background for initial playback start. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_JOINING_FOREGROUND() = 2` Playback is buffering in the foreground for initial playback start. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_NOT_STARTED() = 0` Playback has not started (initial state). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_PAUSED() = 4` Playback is paused but ready to play. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_PAUSED_BUFFERING() = 7` Playback is buffering while paused. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_PLAYING() = 3` Playback is actively playing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_SEEKING() = 5` Playback is handling a seek. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_STOPPED() = 12` Playback is stopped and can be restarted. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_SUPPRESSED() = 9` Playback is suppressed (e.g. due to audio focus loss). |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_SUPPRESSED_BUFFERING() = 10` Playback is suppressed (e.g. due to audio focus loss) while buffering to resume a playback. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getAbandonedBeforeReadyRatio()()` Returns the ratio of foreground playbacks which were abandoned before they were ready to play, or `0.0` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getAudioUnderrunRate()()` Returns the mean rate at which audio underruns occurred, in underruns per play time second, or `0.0` if no time was spent playing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getDroppedFramesRate()()` Returns the mean rate at which video frames are dropped, in dropped frames per play time second, or `0.0` if no time was spent playing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getEndedRatio()()` Returns the ratio of foreground playbacks which reached the ended state at least once, or `0.0` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getFatalErrorRate()()` Returns the rate of fatal errors, in errors per play time second, or `0.0` if no time was spend playing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getFatalErrorRatio()()` Returns the ratio of foreground playbacks which experienced fatal errors, or `0.0` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getJoinTimeRatio()()` Returns the ratio of foreground join time to the total time spent playing and waiting, or `0.0` if no time was spend playing or waiting. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanAudioFormatBitrate()()` Returns the mean audio format bitrate, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no audio format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanBandwidth()()` Returns the mean network bandwidth based on transfer measurements, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no transfer data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanElapsedTimeMs()()` Returns the mean time covered by any playback state per playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback was recorded. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanInitialAudioFormatBitrate()()` Returns the mean initial audio format bitrate, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no audio format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanInitialVideoFormatBitrate()()` Returns the mean initial video format bitrate, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no video format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanInitialVideoFormatHeight()()` Returns the mean initial video format height, in pixels, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no video format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanJoinTimeMs()()` Returns the mean time spent joining the playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no valid join time is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanNonFatalErrorCount()()` Returns the mean number of non-fatal errors per foreground playback, or `0.0` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanPauseBufferCount()()` Returns the mean number of times a playback has been paused while rebuffering per foreground playback, or `0.0` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanPauseCount()()` Returns the mean number of times a playback has been paused per foreground playback, or ` 0.0` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanPausedTimeMs()()` Returns the mean time spent in a paused state per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanPlayAndWaitTimeMs()()` Returns the mean time spent playing or actively waiting for playback per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanPlayTimeMs()()` Returns the mean time spent actively playing per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanRebufferCount()()` Returns the mean number of times a rebuffer occurred per foreground playback, or `0.0` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanRebufferTimeMs()()` Returns the mean time spent rebuffering per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanSeekCount()()` Returns the mean number of times a seek occurred per foreground playback, or `0.0` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanSeekTimeMs()()` Returns the mean time spent per foreground playback from the start of a seek until playback is ready again, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanSingleRebufferTimeMs()()` Returns the mean time spent during a single rebuffer, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no rebuffer was recorded. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanSingleSeekTimeMs()()` Returns the mean time spent from the start of a single seek until playback is ready again, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no seek occurred. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanTimeBetweenFatalErrors()()` Returns the mean play time between fatal errors, in seconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanTimeBetweenNonFatalErrors()()` Returns the mean play time between non-fatal errors, in seconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanTimeBetweenRebuffers()()` Returns the mean play time between rebuffer events, in seconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanVideoFormatBitrate()()` Returns the mean video format bitrate, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no video format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanVideoFormatHeight()()` Returns the mean video format height, in pixels, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no video format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanWaitTimeMs()()` Returns the mean time spent actively waiting for playback per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMediaTimeMsAtRealtimeMs(long)(realtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns the estimated media time at the given realtime, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the media time history is unknown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getNonFatalErrorRate()()` Returns the rate of non-fatal errors, in errors per play time second, or `0.0` if no time was spend playing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getPlaybackStateAtTime(long)(realtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.PlaybackState` at the given time. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getPlaybackStateDurationMs(int)(playbackState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the total time spent in a given `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.PlaybackState`, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getRebufferRate()()` Returns the rate of rebuffer events, in rebuffers per play time second, or `0.0` if no time was spend playing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getRebufferTimeRatio()()` Returns the ratio of rebuffer time to the total time spent playing and waiting, or `0.0` if no time was spend playing or waiting. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getSeekTimeRatio()()` Returns the ratio of seek time to the total time spent playing and waiting, or `0.0` if no time was spend playing or waiting. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalElapsedTimeMs()()` Returns the total time covered by any playback state, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalJoinTimeMs()()` Returns the total time spent joining the playback in foreground, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalPausedTimeMs()()` Returns the total time spent in a paused state, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalPlayAndWaitTimeMs()()` Returns the total time spent playing or actively waiting for playback, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalPlayTimeMs()()` Returns the total time spent actively playing, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalRebufferTimeMs()()` Returns the total time spent rebuffering, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalSeekTimeMs()()` Returns the total time spent from the start of a seek until playback is ready again, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalWaitTimeMs()()` Returns the total time spent actively waiting for playback, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getWaitTimeRatio()()` Returns the ratio of wait times to the total time spent playing and waiting, or `0.0` if no time was spend playing or waiting. |
| `java-static https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#merge(androidx.media3.exoplayer.analytics.PlaybackStats...)(playbackStats: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats!>!)` Returns the combined `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats` for all input `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats`. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#abandonedBeforeReadyCount()` The number of playbacks which were abandoned before they were ready to play. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#adPlaybackCount()` The number of ad playbacks. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndFormat!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#audioFormatHistory()` The audio format history as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndFormat` ordered by ` EventTime.realTimeMs`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#backgroundJoiningCount()` The number of playbacks which were pre-buffered in the background. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#endedCount()` The number of playbacks which reached the ended state at least once. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#fatalErrorCount()` The total number of fatal errors. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndException!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#fatalErrorHistory()` The history of fatal errors as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndException` ordered by `EventTime.realTimeMs`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#fatalErrorPlaybackCount()` The total number of playback with at least one fatal error. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#firstReportedTimeMs()` The elapsed real-time as returned by `SystemClock.elapsedRealtime()` of the first reported playback event, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no event has been reported. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#foregroundPlaybackCount()` The number of playbacks which were the active foreground playback at some point. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#initialAudioFormatBitrateCount()` The number of playbacks with initial audio format bitrate data. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#initialVideoFormatBitrateCount()` The number of playbacks with initial video format bitrate data. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#initialVideoFormatHeightCount()` The number of playbacks with initial video format height data. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#maxRebufferTimeMs()` The maximum time spent during a single rebuffer, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no rebuffer occurred. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#mediaTimeHistory()` The media time history as an ordered list of long\[2\] arrays with \[0\] being the realtime as returned by `SystemClock.elapsedRealtime()` and \[1\] being the media time at this realtime, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#nonFatalErrorCount()` The total number of non-fatal errors. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndException!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#nonFatalErrorHistory()` The history of non-fatal errors as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndException` ordered by `EventTime.realTimeMs`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#playbackCount()` The number of individual playbacks for which these stats were collected. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndPlaybackState!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#playbackStateHistory()` The playback state history as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndPlaybackState` ordered by `EventTime.realTimeMs`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalAudioFormatBitrateTimeProduct()` The accumulated sum of all audio format bitrates, in bits per second, times the time the format was used for playback, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalAudioFormatTimeMs()` The total media time for which audio format data is available, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalAudioUnderruns()` The total number of audio underruns. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalBandwidthBytes()` The total bytes transferred during `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalBandwidthTimeMs()`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalBandwidthTimeMs()` The total time for which bandwidth measurement data is available, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalDroppedFrames()` The total number of dropped video frames. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalInitialAudioFormatBitrate()` The total initial audio format bitrate for all playbacks, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no initial audio format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalInitialVideoFormatBitrate()` The total initial video format bitrate for all playbacks, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no initial video format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalInitialVideoFormatHeight()` The total initial video format height for all playbacks, in pixels, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no initial video format data is available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalPauseBufferCount()` The total number of times a playback has been paused while rebuffering. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalPauseCount()` The total number of times a playback has been paused. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalRebufferCount()` The total number of times a rebuffer occurred. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalSeekCount()` The total number of times a seek occurred. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalValidJoinTimeMs()` The total time spent joining the playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no valid join time could be determined. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalVideoFormatBitrateTimeMs()` The total media time for which video format bitrate data is available, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalVideoFormatBitrateTimeProduct()` The accumulated sum of all video format bitrates, in bits per second, times the time the format was used for playback, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalVideoFormatHeightTimeMs()` The total media time for which video format height data is available, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalVideoFormatHeightTimeProduct()` The accumulated sum of all video format heights, in pixels, times the time the format was used for playback, in milliseconds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#validJoinTimeCount()` The number of playbacks with a valid join time as documented in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalValidJoinTimeMs()`. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndFormat!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#videoFormatHistory()` The video format history as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndFormat` ordered by ` EventTime.realTimeMs`. |

## Constants

### EMPTY

```
const val EMPTY: PlaybackStats!
```

Empty playback stats.

### PLAYBACK_STATE_ABANDONED

```
const val PLAYBACK_STATE_ABANDONED = 15: Int
```

Playback is abandoned before reaching the end of the media.

### PLAYBACK_STATE_BUFFERING

```
const val PLAYBACK_STATE_BUFFERING = 6: Int
```

Playback is buffering to resume active playback.

### PLAYBACK_STATE_ENDED

```
const val PLAYBACK_STATE_ENDED = 11: Int
```

Playback has reached the end of the media.

### PLAYBACK_STATE_FAILED

```
const val PLAYBACK_STATE_FAILED = 13: Int
```

Playback is stopped due a fatal error and can be retried.

### PLAYBACK_STATE_INTERRUPTED_BY_AD

```
const val PLAYBACK_STATE_INTERRUPTED_BY_AD = 14: Int
```

Playback is interrupted by an ad.

### PLAYBACK_STATE_JOINING_BACKGROUND

```
const val PLAYBACK_STATE_JOINING_BACKGROUND = 1: Int
```

Playback is buffering in the background for initial playback start.

### PLAYBACK_STATE_JOINING_FOREGROUND

```
const val PLAYBACK_STATE_JOINING_FOREGROUND = 2: Int
```

Playback is buffering in the foreground for initial playback start.

### PLAYBACK_STATE_NOT_STARTED

```
const val PLAYBACK_STATE_NOT_STARTED = 0: Int
```

Playback has not started (initial state).

### PLAYBACK_STATE_PAUSED

```
const val PLAYBACK_STATE_PAUSED = 4: Int
```

Playback is paused but ready to play.

### PLAYBACK_STATE_PAUSED_BUFFERING

```
const val PLAYBACK_STATE_PAUSED_BUFFERING = 7: Int
```

Playback is buffering while paused.

### PLAYBACK_STATE_PLAYING

```
const val PLAYBACK_STATE_PLAYING = 3: Int
```

Playback is actively playing.

### PLAYBACK_STATE_SEEKING

```
const val PLAYBACK_STATE_SEEKING = 5: Int
```

Playback is handling a seek.

### PLAYBACK_STATE_STOPPED

```
const val PLAYBACK_STATE_STOPPED = 12: Int
```

Playback is stopped and can be restarted.

### PLAYBACK_STATE_SUPPRESSED

```
const val PLAYBACK_STATE_SUPPRESSED = 9: Int
```

Playback is suppressed (e.g. due to audio focus loss).

### PLAYBACK_STATE_SUPPRESSED_BUFFERING

```
const val PLAYBACK_STATE_SUPPRESSED_BUFFERING = 10: Int
```

Playback is suppressed (e.g. due to audio focus loss) while buffering to resume a playback.

## Public functions

### getAbandonedBeforeReadyRatio

```
fun getAbandonedBeforeReadyRatio(): Float
```

Returns the ratio of foreground playbacks which were abandoned before they were ready to play, or `0.0` if no playback has been in foreground.

### getAudioUnderrunRate

```
fun getAudioUnderrunRate(): Float
```

Returns the mean rate at which audio underruns occurred, in underruns per play time second, or `0.0` if no time was spent playing.

### getDroppedFramesRate

```
fun getDroppedFramesRate(): Float
```

Returns the mean rate at which video frames are dropped, in dropped frames per play time second, or `0.0` if no time was spent playing.

### getEndedRatio

```
fun getEndedRatio(): Float
```

Returns the ratio of foreground playbacks which reached the ended state at least once, or `0.0` if no playback has been in foreground.

### getFatalErrorRate

```
fun getFatalErrorRate(): Float
```

Returns the rate of fatal errors, in errors per play time second, or `0.0` if no time was spend playing. This is equivalent to 1.0 / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanTimeBetweenFatalErrors()`.

### getFatalErrorRatio

```
fun getFatalErrorRatio(): Float
```

Returns the ratio of foreground playbacks which experienced fatal errors, or `0.0` if no playback has been in foreground.

### getJoinTimeRatio

```
fun getJoinTimeRatio(): Float
```

Returns the ratio of foreground join time to the total time spent playing and waiting, or `0.0` if no time was spend playing or waiting. This is equivalent to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalJoinTimeMs()` / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalPlayAndWaitTimeMs()`.

### getMeanAudioFormatBitrate

```
fun getMeanAudioFormatBitrate(): Int
```

Returns the mean audio format bitrate, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no audio format data is available. This is a weighted average taking the time the format was used for playback into account.

### getMeanBandwidth

```
fun getMeanBandwidth(): Int
```

Returns the mean network bandwidth based on transfer measurements, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no transfer data is available.

### getMeanElapsedTimeMs

```
fun getMeanElapsedTimeMs(): Long
```

Returns the mean time covered by any playback state per playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback was recorded.

### getMeanInitialAudioFormatBitrate

```
fun getMeanInitialAudioFormatBitrate(): Int
```

Returns the mean initial audio format bitrate, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no audio format data is available.

### getMeanInitialVideoFormatBitrate

```
fun getMeanInitialVideoFormatBitrate(): Int
```

Returns the mean initial video format bitrate, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no video format data is available.

### getMeanInitialVideoFormatHeight

```
fun getMeanInitialVideoFormatHeight(): Int
```

Returns the mean initial video format height, in pixels, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no video format data is available.

### getMeanJoinTimeMs

```
fun getMeanJoinTimeMs(): Long
```

Returns the mean time spent joining the playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no valid join time is available. Only includes playbacks with valid join times as documented in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalValidJoinTimeMs()`.

### getMeanNonFatalErrorCount

```
fun getMeanNonFatalErrorCount(): Float
```

Returns the mean number of non-fatal errors per foreground playback, or `0.0` if no playback has been in foreground.

### getMeanPauseBufferCount

```
fun getMeanPauseBufferCount(): Float
```

Returns the mean number of times a playback has been paused while rebuffering per foreground playback, or `0.0` if no playback has been in foreground.

### getMeanPauseCount

```
fun getMeanPauseCount(): Float
```

Returns the mean number of times a playback has been paused per foreground playback, or ` 0.0` if no playback has been in foreground.

### getMeanPausedTimeMs

```
fun getMeanPausedTimeMs(): Long
```

Returns the mean time spent in a paused state per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground.

### getMeanPlayAndWaitTimeMs

```
fun getMeanPlayAndWaitTimeMs(): Long
```

Returns the mean time spent playing or actively waiting for playback per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground.

### getMeanPlayTimeMs

```
fun getMeanPlayTimeMs(): Long
```

Returns the mean time spent actively playing per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground.

### getMeanRebufferCount

```
fun getMeanRebufferCount(): Float
```

Returns the mean number of times a rebuffer occurred per foreground playback, or `0.0` if no playback has been in foreground. This excludes initial joining and buffering after seek.

### getMeanRebufferTimeMs

```
fun getMeanRebufferTimeMs(): Long
```

Returns the mean time spent rebuffering per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground. This excludes initial join times, buffer times after a seek and buffering while paused.

### getMeanSeekCount

```
fun getMeanSeekCount(): Float
```

Returns the mean number of times a seek occurred per foreground playback, or `0.0` if no playback has been in foreground. This includes seeks happening before playback resumed after another seek.

### getMeanSeekTimeMs

```
fun getMeanSeekTimeMs(): Long
```

Returns the mean time spent per foreground playback from the start of a seek until playback is ready again, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground.

### getMeanSingleRebufferTimeMs

```
fun getMeanSingleRebufferTimeMs(): Long
```

Returns the mean time spent during a single rebuffer, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no rebuffer was recorded. This excludes initial join times and buffer times after a seek.

### getMeanSingleSeekTimeMs

```
fun getMeanSingleSeekTimeMs(): Long
```

Returns the mean time spent from the start of a single seek until playback is ready again, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no seek occurred.

### getMeanTimeBetweenFatalErrors

```
fun getMeanTimeBetweenFatalErrors(): Float
```

Returns the mean play time between fatal errors, in seconds. This is equivalent to 1.0 / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getFatalErrorRate()`. Note that this may return `https://developer.android.com/reference/java/lang/Float.html#POSITIVE_INFINITY`.

### getMeanTimeBetweenNonFatalErrors

```
fun getMeanTimeBetweenNonFatalErrors(): Float
```

Returns the mean play time between non-fatal errors, in seconds. This is equivalent to 1.0 / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getNonFatalErrorRate()`. Note that this may return `https://developer.android.com/reference/java/lang/Float.html#POSITIVE_INFINITY`.

### getMeanTimeBetweenRebuffers

```
fun getMeanTimeBetweenRebuffers(): Float
```

Returns the mean play time between rebuffer events, in seconds. This is equivalent to 1.0 / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getRebufferRate()`. Note that this may return `https://developer.android.com/reference/java/lang/Float.html#POSITIVE_INFINITY`.

### getMeanVideoFormatBitrate

```
fun getMeanVideoFormatBitrate(): Int
```

Returns the mean video format bitrate, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no video format data is available. This is a weighted average taking the time the format was used for playback into account.

### getMeanVideoFormatHeight

```
fun getMeanVideoFormatHeight(): Int
```

Returns the mean video format height, in pixels, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no video format data is available. This is a weighted average taking the time the format was used for playback into account.

### getMeanWaitTimeMs

```
fun getMeanWaitTimeMs(): Long
```

Returns the mean time spent actively waiting for playback per foreground playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no playback has been in foreground. This includes all join times, rebuffer times and seek times, but excludes times without user intention to play, e.g. all paused states.

### getMediaTimeMsAtRealtimeMs

```
fun getMediaTimeMsAtRealtimeMs(realtimeMs: Long): Long
```

Returns the estimated media time at the given realtime, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if the media time history is unknown.

| Parameters |
|---|---|
| `realtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The realtime as returned by `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The estimated media time in milliseconds at this realtime, `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no estimate can be given. |

### getNonFatalErrorRate

```
fun getNonFatalErrorRate(): Float
```

Returns the rate of non-fatal errors, in errors per play time second, or `0.0` if no time was spend playing. This is equivalent to 1.0 / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanTimeBetweenNonFatalErrors()`.

### getPlaybackStateAtTime

```
fun getPlaybackStateAtTime(realtimeMs: Long): Int
```

Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.PlaybackState` at the given time.

| Parameters |
|---|---|
| `realtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The time as returned by `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.PlaybackState` at that time, or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_NOT_STARTED()` if the given time is before the first known playback state in the history. |

### getPlaybackStateDurationMs

```
fun getPlaybackStateDurationMs(playbackState: Int): Long
```

Returns the total time spent in a given `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.PlaybackState`, in milliseconds.

| Parameters |
|---|---|
| `playbackState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.PlaybackState`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | Total spent in the given playback state, in milliseconds |

### getRebufferRate

```
fun getRebufferRate(): Float
```

Returns the rate of rebuffer events, in rebuffers per play time second, or `0.0` if no time was spend playing. This is equivalent to 1.0 / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getMeanTimeBetweenRebuffers()`.

### getRebufferTimeRatio

```
fun getRebufferTimeRatio(): Float
```

Returns the ratio of rebuffer time to the total time spent playing and waiting, or `0.0` if no time was spend playing or waiting. This is equivalent to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalRebufferTimeMs()` / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalPlayAndWaitTimeMs()`.

### getSeekTimeRatio

```
fun getSeekTimeRatio(): Float
```

Returns the ratio of seek time to the total time spent playing and waiting, or `0.0` if no time was spend playing or waiting. This is equivalent to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalSeekTimeMs()` / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalPlayAndWaitTimeMs()`.

### getTotalElapsedTimeMs

```
fun getTotalElapsedTimeMs(): Long
```

Returns the total time covered by any playback state, in milliseconds.

### getTotalJoinTimeMs

```
fun getTotalJoinTimeMs(): Long
```

Returns the total time spent joining the playback in foreground, in milliseconds. This does include invalid join times where the playback never reached `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_PLAYING()` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_PAUSED()`, or joining was interrupted by a seek, stop, or error state.

### getTotalPausedTimeMs

```
fun getTotalPausedTimeMs(): Long
```

Returns the total time spent in a paused state, in milliseconds.

### getTotalPlayAndWaitTimeMs

```
fun getTotalPlayAndWaitTimeMs(): Long
```

Returns the total time spent playing or actively waiting for playback, in milliseconds.

### getTotalPlayTimeMs

```
fun getTotalPlayTimeMs(): Long
```

Returns the total time spent actively playing, in milliseconds.

### getTotalRebufferTimeMs

```
fun getTotalRebufferTimeMs(): Long
```

Returns the total time spent rebuffering, in milliseconds. This excludes initial join times, buffer times after a seek and buffering while paused.

### getTotalSeekTimeMs

```
fun getTotalSeekTimeMs(): Long
```

Returns the total time spent from the start of a seek until playback is ready again, in milliseconds.

### getTotalWaitTimeMs

```
fun getTotalWaitTimeMs(): Long
```

Returns the total time spent actively waiting for playback, in milliseconds. This includes all join times, rebuffer times and seek times, but excludes times without user intention to play, e.g. all paused states.

### getWaitTimeRatio

```
fun getWaitTimeRatio(): Float
```

Returns the ratio of wait times to the total time spent playing and waiting, or `0.0` if no time was spend playing or waiting. This is equivalent to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalWaitTimeMs()` / `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getTotalPlayAndWaitTimeMs()` and also to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getJoinTimeRatio()` + `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getRebufferTimeRatio()` + `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#getSeekTimeRatio()`.

### merge

```
java-static fun merge(playbackStats: Array<PlaybackStats!>!): PlaybackStats!
```

Returns the combined `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats` for all input `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats`.

Note that the full history of events is not kept as the history only makes sense in the context of a single playback.

| Parameters |
|---|---|
| `playbackStats: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats!>!` | Array of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats` to combine. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats!` | The combined `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats`. |

## Public properties

### abandonedBeforeReadyCount

```
val abandonedBeforeReadyCount: Int
```

The number of playbacks which were abandoned before they were ready to play.

### adPlaybackCount

```
val adPlaybackCount: Int
```

The number of ad playbacks.

### audioFormatHistory

```
val audioFormatHistory: (Mutable)List<PlaybackStats.EventTimeAndFormat!>!
```

The audio format history as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndFormat` ordered by ` EventTime.realTimeMs`. The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` may be null if no audio format was used.

### backgroundJoiningCount

```
val backgroundJoiningCount: Int
```

The number of playbacks which were pre-buffered in the background.

### endedCount

```
val endedCount: Int
```

The number of playbacks which reached the ended state at least once.

### fatalErrorCount

```
val fatalErrorCount: Int
```

The total number of fatal errors. Errors are fatal if playback stopped due to this error.

### fatalErrorHistory

```
val fatalErrorHistory: (Mutable)List<PlaybackStats.EventTimeAndException!>!
```

The history of fatal errors as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndException` ordered by `EventTime.realTimeMs`. Errors are fatal if playback stopped due to this error.

### fatalErrorPlaybackCount

```
val fatalErrorPlaybackCount: Int
```

The total number of playback with at least one fatal error. Errors are fatal if playback stopped due to this error.

### firstReportedTimeMs

```
val firstReportedTimeMs: Long
```

The elapsed real-time as returned by `SystemClock.elapsedRealtime()` of the first reported playback event, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no event has been reported.

### foregroundPlaybackCount

```
val foregroundPlaybackCount: Int
```

The number of playbacks which were the active foreground playback at some point.

### initialAudioFormatBitrateCount

```
val initialAudioFormatBitrateCount: Int
```

The number of playbacks with initial audio format bitrate data.

### initialVideoFormatBitrateCount

```
val initialVideoFormatBitrateCount: Int
```

The number of playbacks with initial video format bitrate data.

### initialVideoFormatHeightCount

```
val initialVideoFormatHeightCount: Int
```

The number of playbacks with initial video format height data.

### maxRebufferTimeMs

```
val maxRebufferTimeMs: Long
```

The maximum time spent during a single rebuffer, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no rebuffer occurred.

### mediaTimeHistory

```
val mediaTimeHistory: (Mutable)List<Array<Long>!>!
```

The media time history as an ordered list of long\[2\] arrays with \[0\] being the realtime as returned by `SystemClock.elapsedRealtime()` and \[1\] being the media time at this realtime, in milliseconds.

### nonFatalErrorCount

```
val nonFatalErrorCount: Int
```

The total number of non-fatal errors. Error are non-fatal if playback can recover from the error without stopping.

### nonFatalErrorHistory

```
val nonFatalErrorHistory: (Mutable)List<PlaybackStats.EventTimeAndException!>!
```

The history of non-fatal errors as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndException` ordered by `EventTime.realTimeMs`. Errors are non-fatal if playback can recover from the error without stopping.

### playbackCount

```
val playbackCount: Int
```

The number of individual playbacks for which these stats were collected.

### playbackStateHistory

```
val playbackStateHistory: (Mutable)List<PlaybackStats.EventTimeAndPlaybackState!>!
```

The playback state history as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndPlaybackState` ordered by `EventTime.realTimeMs`.

### totalAudioFormatBitrateTimeProduct

```
val totalAudioFormatBitrateTimeProduct: Long
```

The accumulated sum of all audio format bitrates, in bits per second, times the time the format was used for playback, in milliseconds.

### totalAudioFormatTimeMs

```
val totalAudioFormatTimeMs: Long
```

The total media time for which audio format data is available, in milliseconds.

### totalAudioUnderruns

```
val totalAudioUnderruns: Long
```

The total number of audio underruns.

### totalBandwidthBytes

```
val totalBandwidthBytes: Long
```

The total bytes transferred during `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalBandwidthTimeMs()`.

### totalBandwidthTimeMs

```
val totalBandwidthTimeMs: Long
```

The total time for which bandwidth measurement data is available, in milliseconds.

### totalDroppedFrames

```
val totalDroppedFrames: Long
```

The total number of dropped video frames.

### totalInitialAudioFormatBitrate

```
val totalInitialAudioFormatBitrate: Long
```

The total initial audio format bitrate for all playbacks, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no initial audio format data is available.

### totalInitialVideoFormatBitrate

```
val totalInitialVideoFormatBitrate: Long
```

The total initial video format bitrate for all playbacks, in bits per second, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no initial video format data is available.

### totalInitialVideoFormatHeight

```
val totalInitialVideoFormatHeight: Int
```

The total initial video format height for all playbacks, in pixels, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no initial video format data is available.

### totalPauseBufferCount

```
val totalPauseBufferCount: Int
```

The total number of times a playback has been paused while rebuffering.

### totalPauseCount

```
val totalPauseCount: Int
```

The total number of times a playback has been paused.

### totalRebufferCount

```
val totalRebufferCount: Int
```

The total number of times a rebuffer occurred. This excludes initial joining and buffering after seek.

### totalSeekCount

```
val totalSeekCount: Int
```

The total number of times a seek occurred. This includes seeks happening before playback resumed after another seek.

### totalValidJoinTimeMs

```
val totalValidJoinTimeMs: Long
```

The total time spent joining the playback, in milliseconds, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` if no valid join time could be determined.

Note that this does not include background joining time. A join time may be invalid if the playback never reached `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_PLAYING()` or `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#PLAYBACK_STATE_PAUSED()`, or joining was interrupted by a seek, stop, or error state.

### totalVideoFormatBitrateTimeMs

```
val totalVideoFormatBitrateTimeMs: Long
```

The total media time for which video format bitrate data is available, in milliseconds.

### totalVideoFormatBitrateTimeProduct

```
val totalVideoFormatBitrateTimeProduct: Long
```

The accumulated sum of all video format bitrates, in bits per second, times the time the format was used for playback, in milliseconds.

### totalVideoFormatHeightTimeMs

```
val totalVideoFormatHeightTimeMs: Long
```

The total media time for which video format height data is available, in milliseconds.

### totalVideoFormatHeightTimeProduct

```
val totalVideoFormatHeightTimeProduct: Long
```

The accumulated sum of all video format heights, in pixels, times the time the format was used for playback, in milliseconds.

### validJoinTimeCount

```
val validJoinTimeCount: Int
```

The number of playbacks with a valid join time as documented in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats#totalValidJoinTimeMs()`.

### videoFormatHistory

```
val videoFormatHistory: (Mutable)List<PlaybackStats.EventTimeAndFormat!>!
```

The video format history as `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/analytics/PlaybackStats.EventTimeAndFormat` ordered by ` EventTime.realTimeMs`. The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` may be null if no video format was used.