HlsContentSteeringTracker


@UnstableApi
class HlsContentSteeringTracker : BaseContentSteeringTracker


Tracks the content steering states for an HLS stream.

Summary

Nested types

A callback to be notified of HlsContentSteeringTracker events.

Public constructors

HlsContentSteeringTracker(
    dataSourceFactory: HlsDataSourceFactory!,
    downloadExecutorSupplier: Supplier<ReleasableExecutor!>?,
    playlistTracker: HlsPlaylistTracker!,
    callback: HlsContentSteeringTracker.Callback?,
    bandwidthMeter: BandwidthMeter!,
    clock: Clock!
)

Creates an HlsContentSteeringTracker.

Public functions

Boolean
excludeCurrentPathway(excludeDurationMs: Long)

Excludes the current pathway for the given duration.

Protected functions

ImmutableMap<String!, String!>!

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

Boolean

Returns whether the given pathway is currently available.

Unit
onStart(initialPathwayIds: ImmutableList<String!>!)

Called when the tracker is started.

Unit

Called when tracking is stopped.

Unit

Performs a pathway clone defined in the steering manifest.

Unit

Performs a pathway evaluation based on the passed pathway priority.

Inherited functions

From androidx.media3.exoplayer.upstream.contentsteering.BaseContentSteeringTracker
java-static Uri!
applyUriReplacement(
    baseUri: Uri!,
    uriReplacement: SteeringManifest.UriReplacement!
)

Applies a SteeringManifest.UriReplacement to a base URI.

Unit

Releases the Content Steering tracker.

Unit
start(
    initialSteeringManifestUri: Uri!,
    initialPathwayIds: ImmutableList<String!>!,
    eventDispatcher: MediaSourceEventListener.EventDispatcher!
)

Starts the Content Steering tracker.

Public constructors

HlsContentSteeringTracker

HlsContentSteeringTracker(
    dataSourceFactory: HlsDataSourceFactory!,
    downloadExecutorSupplier: Supplier<ReleasableExecutor!>?,
    playlistTracker: HlsPlaylistTracker!,
    callback: HlsContentSteeringTracker.Callback?,
    bandwidthMeter: BandwidthMeter!,
    clock: Clock!
)

Creates an HlsContentSteeringTracker.

Parameters
dataSourceFactory: HlsDataSourceFactory!

The HlsDataSourceFactory.

downloadExecutorSupplier: Supplier<ReleasableExecutor!>?

A supplier to obtain a ReleasableExecutor, or null.

playlistTracker: HlsPlaylistTracker!

The HlsPlaylistTracker.

callback: HlsContentSteeringTracker.Callback?

A HlsContentSteeringTracker.Callback to receive events, or null.

bandwidthMeter: BandwidthMeter!

The BandwidthMeter.

clock: Clock!

The Clock.

Public functions

excludeCurrentPathway

fun excludeCurrentPathway(excludeDurationMs: Long): Boolean

Excludes the current pathway for the given duration.

Parameters
excludeDurationMs: Long

The duration in milliseconds to exclude the current pathway.

Returns
Boolean

Whether the current pathway was excluded.

Protected functions

getSteeringQueryParameters

protected fun getSteeringQueryParameters(): ImmutableMap<String!, String!>!

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

isPathwayAvailable

protected fun isPathwayAvailable(pathwayId: String!): Boolean

Returns whether the given pathway is currently available.

Parameters
pathwayId: String!

The ID of the pathway to check.

Returns
Boolean

Whether the given pathway is available.

onStart

protected fun onStart(initialPathwayIds: ImmutableList<String!>!): Unit

Called when the tracker is started.

Parameters
initialPathwayIds: ImmutableList<String!>!

The IDs of the initial pathways to be used before the first steering manifest is loaded.

onStop

protected fun onStop(): Unit

Called when tracking is stopped.

This can be either externally called by release or internally due to an unrecoverable error.

performPathwayClone

protected fun performPathwayClone(pathwayClone: SteeringManifest.PathwayClone!): Unit

Performs a pathway clone defined in the steering manifest.

Parameters
pathwayClone: SteeringManifest.PathwayClone!

The SteeringManifest.PathwayClone to perform.

performPathwayEvaluation

protected fun performPathwayEvaluation(pathwayPriority: ImmutableList<String!>!): Unit

Performs a pathway evaluation based on the passed pathway priority.

Parameters
pathwayPriority: ImmutableList<String!>!

The pathway priority to use for evaluation.