# DefaultHlsPlaylistTracker

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

*** ** * ** ***


```
@UnstableApi
class DefaultHlsPlaylistTracker : HlsPlaylistTracker, Loader.Callback<ParsingLoadable<HlsPlaylist!>!>
```

<br />

*** ** * ** ***

Default implementation for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker`.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#DEFAULT_PLAYLIST_STUCK_TARGET_DURATION_COEFFICIENT() = 3.5` Default coefficient applied on the target duration of a playlist to determine the amount of time after which an unchanging playlist is considered stuck. |
| `const https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker.Factory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#FACTORY()` Factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker` instances. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#DefaultHlsPlaylistTracker(androidx.media3.exoplayer.hls.HlsDataSourceFactory,androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy,androidx.media3.exoplayer.hls.playlist.HlsPlaylistParserFactory,androidx.media3.exoplayer.upstream.CmcdConfiguration,com.google.common.base.Supplier<androidx.media3.exoplayer.util.ReleasableExecutor>)( dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/HlsDataSourceFactory!, loadErrorHandlingPolicy: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy!, playlistParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParserFactory!, cmcdConfiguration: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration?, downloadExecutorSupplier: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor!>? )` Creates an instance. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#DefaultHlsPlaylistTracker(androidx.media3.exoplayer.hls.HlsDataSourceFactory,androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy,androidx.media3.exoplayer.hls.playlist.HlsPlaylistParserFactory,androidx.media3.exoplayer.upstream.CmcdConfiguration,double,com.google.common.base.Supplier<androidx.media3.exoplayer.util.ReleasableExecutor>)( dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/HlsDataSourceFactory!, loadErrorHandlingPolicy: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy!, playlistParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParserFactory!, cmcdConfiguration: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration?, playlistStuckTargetDurationCoefficient: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html, downloadExecutorSupplier: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor!>? )` Creates an instance. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#addListener(androidx.media3.exoplayer.hls.playlist.HlsPlaylistTracker.PlaylistEventListener)(listener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker.PlaylistEventListener!)` Registers a listener to receive events from the playlist tracker. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#deactivatePlaylistForPlayback(android.net.Uri)(url: https://developer.android.com/reference/android/net/Uri.html!)` Deactivate the playlist for playback. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#excludeMediaPlaylist(android.net.Uri,long)(playlistUrl: https://developer.android.com/reference/android/net/Uri.html!, exclusionDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Excludes the given media playlist for the given duration, in milliseconds. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#getPlaylistSnapshot(android.net.Uri,boolean)(url: https://developer.android.com/reference/android/net/Uri.html!, isForPlayback: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns the most recent snapshot available of the playlist referenced by the provided `https://developer.android.com/reference/android/net/Uri.html`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#getRedundantGroup(android.net.Uri)(playlistUrl: https://developer.android.com/reference/android/net/Uri.html!)` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup` where the `playlistUrl` belongs. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup!>?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#getRedundantGroups(int)(@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup.Type type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup` list corresponding to the `type`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#isExcluded(android.net.Uri,long)(playlistUrl: https://developer.android.com/reference/android/net/Uri.html!, nowMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns whether the `playlistUrl` is excluded at the given `nowMs` time. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#isExcluded(androidx.media3.exoplayer.hls.playlist.HlsRedundantGroup,long)(redundantGroup: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup!, nowMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Returns whether all playlist URLs in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup` are `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker#isExcluded(android.net.Uri,long)` at the given `nowMs` time. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#isSnapshotValid(android.net.Uri)(url: https://developer.android.com/reference/android/net/Uri.html!)` Returns whether the snapshot of the playlist referenced by the provided `https://developer.android.com/reference/android/net/Uri.html` is valid, meaning all the segments referenced by the playlist are expected to be available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#maybeThrowPlaylistRefreshError(android.net.Uri)(url: https://developer.android.com/reference/android/net/Uri.html!)` If the playlist is having trouble refreshing the playlist referenced by the given `https://developer.android.com/reference/android/net/Uri.html`, this method throws the underlying error. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#maybeThrowPrimaryPlaylistRefreshError()()` If the tracker is having trouble refreshing the multivariant playlist or the primary playlist, this method throws the underlying error. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#onLoadCanceled(androidx.media3.exoplayer.upstream.ParsingLoadable<androidx.media3.exoplayer.hls.playlist.HlsPlaylist>,long,long,boolean)( loadable: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylist!>!, elapsedRealtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, loadDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, released: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Called when a load has been canceled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#onLoadCompleted(androidx.media3.exoplayer.upstream.ParsingLoadable<androidx.media3.exoplayer.hls.playlist.HlsPlaylist>,long,long)( loadable: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylist!>!, elapsedRealtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, loadDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Called when a load has completed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.LoadErrorAction!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#onLoadError(androidx.media3.exoplayer.upstream.ParsingLoadable<androidx.media3.exoplayer.hls.playlist.HlsPlaylist>,long,long,java.io.IOException,int)( loadable: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylist!>!, elapsedRealtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, loadDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, error: https://developer.android.com/reference/java/io/IOException.html!, errorCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Called when a load encounters an error. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#onLoadStarted(androidx.media3.exoplayer.upstream.ParsingLoadable<androidx.media3.exoplayer.hls.playlist.HlsPlaylist>,long,long,int)( loadable: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylist!>!, elapsedRealtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, loadDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, retryCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Called when a load has started for the first time or through a retry. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#refreshPlaylist(android.net.Uri)(url: https://developer.android.com/reference/android/net/Uri.html!)` Requests a playlist refresh and removes it from the exclusion list. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#removeListener(androidx.media3.exoplayer.hls.playlist.HlsPlaylistTracker.PlaylistEventListener)(listener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker.PlaylistEventListener!)` Unregisters a listener. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#start(android.net.Uri,androidx.media3.exoplayer.source.MediaSourceEventListener.EventDispatcher,androidx.media3.exoplayer.hls.playlist.HlsPlaylistTracker.PrimaryPlaylistListener,androidx.media3.exoplayer.upstream.BandwidthMeter)( initialPlaylistUri: https://developer.android.com/reference/android/net/Uri.html!, eventDispatcher: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher!, primaryPlaylistListener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker.PrimaryPlaylistListener!, bandwidthMeter: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter! )` Starts the playlist tracker. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#stop()()` Stops the playlist tracker and releases any acquired resources. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/HlsContentSteeringTracker?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#contentSteeringTracker()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#initialStartTimeUs()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#isLive()` |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMultivariantPlaylist?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#multivariantPlaylist()` |

## Constants

### DEFAULT_PLAYLIST_STUCK_TARGET_DURATION_COEFFICIENT

```
const val DEFAULT_PLAYLIST_STUCK_TARGET_DURATION_COEFFICIENT = 3.5: Double
```

Default coefficient applied on the target duration of a playlist to determine the amount of time after which an unchanging playlist is considered stuck.

### FACTORY

```
const val FACTORY: HlsPlaylistTracker.Factory!
```

Factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker` instances.

## Public constructors

### DefaultHlsPlaylistTracker

```
DefaultHlsPlaylistTracker(
    dataSourceFactory: HlsDataSourceFactory!,
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!,
    playlistParserFactory: HlsPlaylistParserFactory!,
    cmcdConfiguration: CmcdConfiguration?,
    downloadExecutorSupplier: Supplier<ReleasableExecutor!>?
)
```

Creates an instance.

| Parameters |
|---|---|
| `dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/HlsDataSourceFactory!` | A factory for `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource` instances. |
| `loadErrorHandlingPolicy: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy`. |
| `playlistParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParserFactory!` | An `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParserFactory`. |
| `cmcdConfiguration: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration`. |
| `downloadExecutorSupplier: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor!>?` | A supplier for a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor` that is used for loading the playlist. |

### DefaultHlsPlaylistTracker

```
DefaultHlsPlaylistTracker(
    dataSourceFactory: HlsDataSourceFactory!,
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!,
    playlistParserFactory: HlsPlaylistParserFactory!,
    cmcdConfiguration: CmcdConfiguration?,
    playlistStuckTargetDurationCoefficient: Double,
    downloadExecutorSupplier: Supplier<ReleasableExecutor!>?
)
```

Creates an instance.

| Parameters |
|---|---|
| `dataSourceFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/HlsDataSourceFactory!` | A factory for `https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource` instances. |
| `loadErrorHandlingPolicy: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy`. |
| `playlistParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParserFactory!` | An `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistParserFactory`. |
| `cmcdConfiguration: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration?` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration`. |
| `playlistStuckTargetDurationCoefficient: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | A coefficient to apply to the target duration of media playlists in order to determine that a non-changing playlist is stuck. Once a playlist is deemed stuck, a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker.PlaylistStuckException` is thrown via `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker#maybeThrowPlaylistRefreshError(android.net.Uri)`. |
| `downloadExecutorSupplier: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor!>?` | A supplier for a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor` that is used for loading the playlist. |

## Public functions

### addListener

```
fun addListener(listener: HlsPlaylistTracker.PlaylistEventListener!): Unit
```

Registers a listener to receive events from the playlist tracker.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker.PlaylistEventListener!` | The listener. |

### deactivatePlaylistForPlayback

```
fun deactivatePlaylistForPlayback(url: Uri!): Unit
```

Deactivate the playlist for playback.

The default implementation is a no-op.

| Parameters |
|---|---|
| `url: https://developer.android.com/reference/android/net/Uri.html!` | The `https://developer.android.com/reference/android/net/Uri.html` of the playlist to deactivate for playback. |

### excludeMediaPlaylist

```
fun excludeMediaPlaylist(playlistUrl: Uri!, exclusionDurationMs: Long): Boolean
```

Excludes the given media playlist for the given duration, in milliseconds.

| Parameters |
|---|---|
| `playlistUrl: https://developer.android.com/reference/android/net/Uri.html!` | The URL of the media playlist. |
| `exclusionDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration for which to exclude the playlist. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether exclusion was successful. |

### getPlaylistSnapshot

```
fun getPlaylistSnapshot(url: Uri!, isForPlayback: Boolean): HlsMediaPlaylist?
```

Returns the most recent snapshot available of the playlist referenced by the provided `https://developer.android.com/reference/android/net/Uri.html`.

| Parameters |
|---|---|
| `url: https://developer.android.com/reference/android/net/Uri.html!` | The `https://developer.android.com/reference/android/net/Uri.html` corresponding to the requested media playlist. |
| `isForPlayback: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the caller might use the snapshot to request media segments for playback. If true, the primary playlist may be updated to the one requested. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist?` | The most recent snapshot of the playlist referenced by the provided `https://developer.android.com/reference/android/net/Uri.html`. May be null if no snapshot has been loaded yet. |

### getRedundantGroup

```
fun getRedundantGroup(playlistUrl: Uri!): HlsRedundantGroup?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup` where the `playlistUrl` belongs.

| Parameters |
|---|---|
| `playlistUrl: https://developer.android.com/reference/android/net/Uri.html!` | The URL of the media playlist. |

### getRedundantGroups

```
fun getRedundantGroups(@HlsRedundantGroup.Type type: Int): ImmutableList<HlsRedundantGroup!>?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup` list corresponding to the `type`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup.Type type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The type of the requested `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup`. |

| Returns |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup!>?` | The list of requested `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup`. Null if the initial playlist has yet to be loaded. |

### isExcluded

```
fun isExcluded(playlistUrl: Uri!, nowMs: Long): Boolean
```

Returns whether the `playlistUrl` is excluded at the given `nowMs` time.

| Parameters |
|---|---|
| `playlistUrl: https://developer.android.com/reference/android/net/Uri.html!` | The URL of the media playlist. |
| `nowMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current value of `https://developer.android.com/reference/kotlin/androidx/media3/common/util/SystemClock#elapsedRealtime()`. |

### isExcluded

```
fun isExcluded(redundantGroup: HlsRedundantGroup!, nowMs: Long): Boolean
```

Returns whether all playlist URLs in the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup` are `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker#isExcluded(android.net.Uri,long)` at the given `nowMs` time.

| Parameters |
|---|---|
| `redundantGroup: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsRedundantGroup`. |
| `nowMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The current value of `https://developer.android.com/reference/kotlin/androidx/media3/common/util/SystemClock#elapsedRealtime()`. |

### isSnapshotValid

```
fun isSnapshotValid(url: Uri!): Boolean
```

Returns whether the snapshot of the playlist referenced by the provided `https://developer.android.com/reference/android/net/Uri.html` is valid, meaning all the segments referenced by the playlist are expected to be available. If the playlist is not valid then some of the segments may no longer be available.

| Parameters |
|---|---|
| `url: https://developer.android.com/reference/android/net/Uri.html!` | The `https://developer.android.com/reference/android/net/Uri.html`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the snapshot of the playlist referenced by the provided `https://developer.android.com/reference/android/net/Uri.html` is valid. |

### maybeThrowPlaylistRefreshError

```
fun maybeThrowPlaylistRefreshError(url: Uri!): Unit
```

If the playlist is having trouble refreshing the playlist referenced by the given `https://developer.android.com/reference/android/net/Uri.html`, this method throws the underlying error.

| Parameters |
|---|---|
| `url: https://developer.android.com/reference/android/net/Uri.html!` | The `https://developer.android.com/reference/android/net/Uri.html`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | The underlying error. |

### maybeThrowPrimaryPlaylistRefreshError

```
fun maybeThrowPrimaryPlaylistRefreshError(): Unit
```

If the tracker is having trouble refreshing the multivariant playlist or the primary playlist, this method throws the underlying error. Otherwise, does nothing.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/io/IOException.html` | The underlying error. |

### onLoadCanceled

```
fun onLoadCanceled(
    loadable: ParsingLoadable<HlsPlaylist!>!,
    elapsedRealtimeMs: Long,
    loadDurationMs: Long,
    released: Boolean
): Unit
```

Called when a load has been canceled.

Note: If the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader` has not been released then there is guaranteed to be a memory barrier between `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable#load()` exiting and this callback being called. If the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader` has been released then this callback may be called before `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable#load()` exits.

| Parameters |
|---|---|
| `loadable: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylist!>!` | The loadable whose load has been canceled. |
| `elapsedRealtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` when the load was canceled. |
| `loadDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration in milliseconds of the load since `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#startLoading(T,androidx.media3.exoplayer.upstream.Loader.Callback<T>,int)` was called up to the point at which it was canceled. |
| `released: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the load was canceled because the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader` was released. False otherwise. |

### onLoadCompleted

```
fun onLoadCompleted(
    loadable: ParsingLoadable<HlsPlaylist!>!,
    elapsedRealtimeMs: Long,
    loadDurationMs: Long
): Unit
```

Called when a load has completed.

Note: There is guaranteed to be a memory barrier between `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable#load()` exiting and this callback being called.

| Parameters |
|---|---|
| `loadable: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylist!>!` | The loadable whose load has completed. |
| `elapsedRealtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` when the load ended. |
| `loadDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration in milliseconds of the load since `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#startLoading(T,androidx.media3.exoplayer.upstream.Loader.Callback<T>,int)` was called. |

### onLoadError

```
fun onLoadError(
    loadable: ParsingLoadable<HlsPlaylist!>!,
    elapsedRealtimeMs: Long,
    loadDurationMs: Long,
    error: IOException!,
    errorCount: Int
): Loader.LoadErrorAction!
```

Called when a load encounters an error.

Note: There is guaranteed to be a memory barrier between `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.Loadable#load()` exiting and this callback being called.

| Parameters |
|---|---|
| `loadable: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylist!>!` | The loadable whose load has encountered an error. |
| `elapsedRealtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` when the error occurred. |
| `loadDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration in milliseconds of the load since `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#startLoading(T,androidx.media3.exoplayer.upstream.Loader.Callback<T>,int)` was called up to the point at which the error occurred. |
| `error: https://developer.android.com/reference/java/io/IOException.html!` | The load error. |
| `errorCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of errors this load has encountered, including this one. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader.LoadErrorAction!` | The desired error handling action. One of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#RETRY()`, `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#RETRY_RESET_ERROR_COUNT()`, `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#DONT_RETRY()`, `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#DONT_RETRY_FATAL()` or a retry action created by `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#createRetryAction(boolean,long)`. |

### onLoadStarted

```
fun onLoadStarted(
    loadable: ParsingLoadable<HlsPlaylist!>!,
    elapsedRealtimeMs: Long,
    loadDurationMs: Long,
    retryCount: Int
): Unit
```

Called when a load has started for the first time or through a retry.

This is called for the first time with `retryCount == 0` just **before** the load is started.

| Parameters |
|---|---|
| `loadable: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/ParsingLoadable<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylist!>!` | The loadable whose load has started. |
| `elapsedRealtimeMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/android/os/SystemClock.html#elapsedRealtime()` when the load attempts to start. |
| `loadDurationMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The duration in milliseconds of the load since `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#startLoading(T,androidx.media3.exoplayer.upstream.Loader.Callback<T>,int)` was called. |
| `retryCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of failed attempts since `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/Loader#startLoading(T,androidx.media3.exoplayer.upstream.Loader.Callback<T>,int)` was called (this is zero for the first load attempt). |

### refreshPlaylist

```
fun refreshPlaylist(url: Uri!): Unit
```

Requests a playlist refresh and removes it from the exclusion list.

The playlist tracker may choose to delay the playlist refresh. The request is discarded if a refresh was already pending.

| Parameters |
|---|---|
| `url: https://developer.android.com/reference/android/net/Uri.html!` | The `https://developer.android.com/reference/android/net/Uri.html` of the playlist to be refreshed. |

### removeListener

```
fun removeListener(listener: HlsPlaylistTracker.PlaylistEventListener!): Unit
```

Unregisters a listener.

| Parameters |
|---|---|
| `listener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker.PlaylistEventListener!` | The listener to unregister. |

### start

```
fun start(
    initialPlaylistUri: Uri!,
    eventDispatcher: MediaSourceEventListener.EventDispatcher!,
    primaryPlaylistListener: HlsPlaylistTracker.PrimaryPlaylistListener!,
    bandwidthMeter: BandwidthMeter!
): Unit
```

Starts the playlist tracker.

Must be called from the playback thread. A tracker may be restarted after a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker#stop()` call.

| Parameters |
|---|---|
| `initialPlaylistUri: https://developer.android.com/reference/android/net/Uri.html!` | Uri of the HLS stream. Can point to a media playlist or a multivariant playlist. |
| `eventDispatcher: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher!` | A dispatcher to notify of events. |
| `primaryPlaylistListener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker.PrimaryPlaylistListener!` | A callback for the primary playlist change events. |
| `bandwidthMeter: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter!` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter`. |

### stop

```
fun stop(): Unit
```

Stops the playlist tracker and releases any acquired resources.

Must be called once per `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker#start(android.net.Uri,androidx.media3.exoplayer.source.MediaSourceEventListener.EventDispatcher,androidx.media3.exoplayer.hls.playlist.HlsPlaylistTracker.PrimaryPlaylistListener,androidx.media3.exoplayer.upstream.BandwidthMeter)` call.

## Public properties

### contentSteeringTracker

```
val contentSteeringTracker: HlsContentSteeringTracker?
```

### initialStartTimeUs

```
val initialStartTimeUs: Long
```

### isLive

```
val isLive: Boolean
```

### multivariantPlaylist

```
val multivariantPlaylist: HlsMultivariantPlaylist?
```