# HlsContentSteeringTracker

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

*** ** * ** ***


```
@UnstableApi
public final class HlsContentSteeringTracker extends BaseContentSteeringTracker
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.exoplayer.upstream.contentsteering.BaseContentSteeringTracker](https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker) ||
|   | ↳ | [androidx.media3.exoplayer.hls.HlsContentSteeringTracker](https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker) |

*** ** * ** ***

Tracks the content steering states for an HLS stream.

## Summary

| ### Nested types |
|---|
| `public interface https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker.Callback` A callback to be notified of `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker` events. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker#HlsContentSteeringTracker(androidx.media3.exoplayer.hls.HlsDataSourceFactory,com.google.common.base.Supplier<androidx.media3.exoplayer.util.ReleasableExecutor>,androidx.media3.exoplayer.hls.playlist.HlsPlaylistTracker,androidx.media3.exoplayer.hls.HlsContentSteeringTracker.Callback,androidx.media3.exoplayer.upstream.BandwidthMeter,androidx.media3.common.util.Clock)( https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsDataSourceFactory dataSourceFactory, @https://developer.android.com/reference/androidx/annotation/Nullable https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html<https://developer.android.com/reference/androidx/media3/exoplayer/util/ReleasableExecutor> downloadExecutorSupplier, https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker playlistTracker, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker.Callback callback, https://developer.android.com/reference/androidx/media3/exoplayer/upstream/BandwidthMeter bandwidthMeter, https://developer.android.com/reference/androidx/media3/common/util/Clock clock )` Creates an `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker#excludeCurrentPathway(long)(long excludeDurationMs)` Excludes the current pathway for the given duration. |

| ### Protected methods |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableMap.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker#getSteeringQueryParameters()()` Returns the query parameters to include in the steering manifest request. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker#isPathwayAvailable(java.lang.String)(https://developer.android.com/reference/java/lang/String.html pathwayId)` Returns whether the given pathway is currently available. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker#onStart(com.google.common.collect.ImmutableList<java.lang.String>)(https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html> initialPathwayIds)` Called when the tracker is started. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker#onStop()()` Called when tracking is stopped. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker#performPathwayClone(androidx.media3.exoplayer.upstream.contentsteering.SteeringManifest.PathwayClone)(https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/SteeringManifest.PathwayClone pathwayClone)` Performs a pathway clone defined in the steering manifest. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker#performPathwayEvaluation(com.google.common.collect.ImmutableList<java.lang.String>)(https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html> pathwayPriority)` Performs a pathway evaluation based on the passed pathway priority. |

### Inherited fields

From [androidx.media3.exoplayer.upstream.contentsteering.BaseContentSteeringTracker](https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker) `@https://developer.android.com/reference/androidx/annotation/Nullable https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker#currentPathwayPriority()` `boolean` `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker#isActive()`

### Inherited methods

From [androidx.media3.exoplayer.upstream.contentsteering.BaseContentSteeringTracker](https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker) `static https://developer.android.com/reference/android/net/Uri.html` `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker#applyUriReplacement(android.net.Uri,androidx.media3.exoplayer.upstream.contentsteering.SteeringManifest.UriReplacement)(
https://developer.android.com/reference/android/net/Uri.html baseUri,
https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/SteeringManifest.UriReplacement uriReplacement
)`

Applies a `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/SteeringManifest.UriReplacement` to a base URI.
`final @https://developer.android.com/reference/androidx/annotation/Nullable https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker#getCurrentPathwayPriority()()`

Returns the current pathway priority.
`final boolean` `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker#isActive()()`

Returns whether the Content Steering tracker is active.
`final void` `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker#release()()`

Releases the Content Steering tracker.
`final void` `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker#start(android.net.Uri,com.google.common.collect.ImmutableList<java.lang.String>,androidx.media3.exoplayer.source.MediaSourceEventListener.EventDispatcher)(
https://developer.android.com/reference/android/net/Uri.html initialSteeringManifestUri,
https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html> initialPathwayIds,
https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSourceEventListener.EventDispatcher eventDispatcher
)`

Starts the Content Steering tracker.

## Public constructors

### HlsContentSteeringTracker

```
public HlsContentSteeringTracker(
    HlsDataSourceFactory dataSourceFactory,
    @Nullable Supplier<ReleasableExecutor> downloadExecutorSupplier,
    HlsPlaylistTracker playlistTracker,
    @Nullable HlsContentSteeringTracker.Callback callback,
    BandwidthMeter bandwidthMeter,
    Clock clock
)
```

Creates an `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsDataSourceFactory dataSourceFactory` | The `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsDataSourceFactory`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html<https://developer.android.com/reference/androidx/media3/exoplayer/util/ReleasableExecutor> downloadExecutorSupplier` | A supplier to obtain a `https://developer.android.com/reference/androidx/media3/exoplayer/util/ReleasableExecutor`, or ` null`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker playlistTracker` | The `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylistTracker`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker.Callback callback` | A `https://developer.android.com/reference/androidx/media3/exoplayer/hls/HlsContentSteeringTracker.Callback` to receive events, or ` null`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/BandwidthMeter bandwidthMeter` | The `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/BandwidthMeter`. |
| `https://developer.android.com/reference/androidx/media3/common/util/Clock clock` | The `https://developer.android.com/reference/androidx/media3/common/util/Clock`. |

## Public methods

### excludeCurrentPathway

```
public boolean excludeCurrentPathway(long excludeDurationMs)
```

Excludes the current pathway for the given duration.

| Parameters |
|---|---|
| `long excludeDurationMs` | The duration in milliseconds to exclude the current pathway. |

| Returns |
|---|---|
| `boolean` | Whether the current pathway was excluded. |

## Protected methods

### getSteeringQueryParameters

```
protected ImmutableMap<String, String> getSteeringQueryParameters()
```

Returns the query parameters to include in the steering manifest request.

### isPathwayAvailable

```
protected boolean isPathwayAvailable(String pathwayId)
```

Returns whether the given pathway is currently available.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html pathwayId` | The ID of the pathway to check. |

| Returns |
|---|---|
| `boolean` | Whether the given pathway is available. |

### onStart

```
protected void onStart(ImmutableList<String> initialPathwayIds)
```

Called when the tracker is started.

| Parameters |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html> initialPathwayIds` | The IDs of the initial pathways to be used before the first steering manifest is loaded. |

### onStop

```
protected void onStop()
```

Called when tracking is stopped.

This can be either externally called by `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/BaseContentSteeringTracker#release()` or internally due to an unrecoverable error.

### performPathwayClone

```
protected void performPathwayClone(SteeringManifest.PathwayClone pathwayClone)
```

Performs a pathway clone defined in the steering manifest.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/SteeringManifest.PathwayClone pathwayClone` | The `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/SteeringManifest.PathwayClone` to perform. |

### performPathwayEvaluation

```
protected void performPathwayEvaluation(ImmutableList<String> pathwayPriority)
```

Performs a pathway evaluation based on the passed pathway priority.

| Parameters |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html> pathwayPriority` | The `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/contentsteering/SteeringManifest#pathwayPriority()` to use for evaluation. |