BaseContentSteeringTracker


@UnstableApi
abstract class BaseContentSteeringTracker

Known direct subclasses
DashContentSteeringTracker

Tracks the content steering states for a DASH stream.

HlsContentSteeringTracker

Tracks the content steering states for an HLS stream.


Abstract base class for Content Steering tracker implementations.

It provides common state management for steering manifest tracking, pathway evaluation, and pathway cloning.

Summary

Protected constructors

BaseContentSteeringTracker(
    dataSourceFactory: DataSource.Factory!,
    downloadExecutorSupplier: Supplier<ReleasableExecutor!>?
)

Creates a BaseContentSteeringTracker.

Public functions

Unit

Releases the Content Steering tracker.

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

Starts the Content Steering tracker.

Protected functions

java-static Uri!
applyUriReplacement(
    baseUri: Uri!,
    uriReplacement: SteeringManifest.UriReplacement!
)

Applies a SteeringManifest.UriReplacement to a base URI.

abstract ImmutableMap<String!, String!>!

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

abstract Boolean

Returns whether the given pathway is currently available.

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

Called when the tracker is started.

abstract Unit

Called when tracking is stopped.

abstract Unit

Performs a pathway clone defined in the steering manifest.

abstract Unit

Performs a pathway evaluation based on the passed pathway priority.

Public properties

Boolean

Protected properties

ImmutableList<String!>?

Protected constructors

BaseContentSteeringTracker

protected BaseContentSteeringTracker(
    dataSourceFactory: DataSource.Factory!,
    downloadExecutorSupplier: Supplier<ReleasableExecutor!>?
)

Creates a BaseContentSteeringTracker.

Parameters
dataSourceFactory: DataSource.Factory!

The DataSource.Factory to load steering manifests.

downloadExecutorSupplier: Supplier<ReleasableExecutor!>?

A supplier for a ReleasableExecutor to download steering manifests.

Public functions

release

fun release(): Unit

Releases the Content Steering tracker.

Once released, the tracker cannot be used again.

start

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

Starts the Content Steering tracker.

Parameters
initialSteeringManifestUri: Uri!

The initial Uri of the steering manifest.

initialPathwayIds: ImmutableList<String!>!

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

eventDispatcher: MediaSourceEventListener.EventDispatcher!

A MediaSourceEventListener.EventDispatcher for reporting load events.

Protected functions

applyUriReplacement

protected java-static fun applyUriReplacement(
    baseUri: Uri!,
    uriReplacement: SteeringManifest.UriReplacement!
): Uri!

Applies a SteeringManifest.UriReplacement to a base URI.

Parameters
baseUri: Uri!

The base Uri.

uriReplacement: SteeringManifest.UriReplacement!

The SteeringManifest.UriReplacement.

Returns
Uri!

The updated Uri.

getSteeringQueryParameters

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

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

isPathwayAvailable

protected abstract 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 abstract 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 abstract 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 abstract 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 abstract 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.

Public properties

isActive

val isActive: Boolean

Protected properties

currentPathwayPriority

protected val currentPathwayPriority: ImmutableList<String!>?