DashContentSteeringTracker


@UnstableApi
public final class DashContentSteeringTracker extends BaseContentSteeringTracker


Tracks the content steering states for a DASH stream.

Summary

Nested types

A callback to be notified of DashContentSteeringTracker events.

Provides the information for the query parameters to request the steering manifests.

Public constructors

DashContentSteeringTracker(
    DataSource.Factory dataSourceFactory,
    @Nullable Supplier<ReleasableExecutor> downloadExecutorSupplier,
    @Nullable DashContentSteeringTracker.Callback callback,
    @Nullable TransferListener mediaTransferListener,
    DashManifest manifest
)

Creates a DashContentSteeringTracker.

Public methods

void

Adds a SteeringQueryParamsProvider to the tracker.

@Nullable ImmutableList<String>

Returns the current service location priority, or null if the tracker is inactive or no priority has been established.

TransferListener

Returns the TransferListener that should be used by the DataSource for media loading.

void

Removes a SteeringQueryParamsProvider from the tracker.

void

Updates the DashManifest for the stream.

Protected methods

ImmutableMap<String, String>

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

boolean

Returns whether the given pathway is currently available.

void
onStart(ImmutableList<String> initialPathwayIds)

Called when the tracker is started.

void

Called when tracking is stopped.

void

Performs a pathway clone defined in the steering manifest.

void

Performs a pathway evaluation based on the passed pathway priority.

Inherited methods

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

Applies a SteeringManifest.UriReplacement to a base URI.

final @Nullable ImmutableList<String>

Returns the current pathway priority.

final boolean

Returns whether the Content Steering tracker is active.

final void

Releases the Content Steering tracker.

final void
start(
    Uri initialSteeringManifestUri,
    ImmutableList<String> initialPathwayIds,
    MediaSourceEventListener.EventDispatcher eventDispatcher
)

Starts the Content Steering tracker.

Public constructors

DashContentSteeringTracker

public DashContentSteeringTracker(
    DataSource.Factory dataSourceFactory,
    @Nullable Supplier<ReleasableExecutor> downloadExecutorSupplier,
    @Nullable DashContentSteeringTracker.Callback callback,
    @Nullable TransferListener mediaTransferListener,
    DashManifest manifest
)

Creates a DashContentSteeringTracker.

Parameters
DataSource.Factory dataSourceFactory

The DataSource.Factory.

@Nullable Supplier<ReleasableExecutor> downloadExecutorSupplier

A supplier for a ReleasableExecutor, or null.

@Nullable DashContentSteeringTracker.Callback callback

A Callback.

@Nullable TransferListener mediaTransferListener

The TransferListener to be used by the DataSource for media loading, which should be the TransferListener passed to the DashMediaSource when the source is prepared.

DashManifest manifest

The DashManifest.

Public methods

addSteeringQueryParamsProvider

public void addSteeringQueryParamsProvider(
    DashContentSteeringTracker.SteeringQueryParamsProvider provider
)

Adds a SteeringQueryParamsProvider to the tracker.

getCurrentServiceLocationPriority

public @Nullable ImmutableList<String> getCurrentServiceLocationPriority()

Returns the current service location priority, or null if the tracker is inactive or no priority has been established.

getMediaTransferListener

public TransferListener getMediaTransferListener()

Returns the TransferListener that should be used by the DataSource for media loading.

removeSteeringQueryParamsProvider

public void removeSteeringQueryParamsProvider(
    DashContentSteeringTracker.SteeringQueryParamsProvider provider
)

Removes a SteeringQueryParamsProvider from the tracker.

updateManifest

public void updateManifest(DashManifest manifest)

Updates the DashManifest for the stream.

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
String 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
ImmutableList<String> 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 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
SteeringManifest.PathwayClone pathwayClone

The SteeringManifest.PathwayClone to perform.

performPathwayEvaluation

protected void performPathwayEvaluation(ImmutableList<String> pathwayPriority)

Performs a pathway evaluation based on the passed pathway priority.

Parameters
ImmutableList<String> pathwayPriority

The pathway priority to use for evaluation.