TrackSelectorResult


@UnstableApi
public final class TrackSelectorResult


The result of a TrackSelector operation.

Summary

Public fields

final @Nullable Object

An opaque object that will be returned to onSelectionActivated should the selections be activated.

final int

The number of selections in the result.

final RendererConfiguration[]

A RendererConfiguration for each renderer.

final ExoTrackSelection[]

A ExoTrackSelection array containing the track selection for each renderer.

final Tracks

Describe the tracks and which one were selected.

Public constructors

TrackSelectorResult(
    @NullableType RendererConfiguration[] rendererConfigurations,
    @NullableType ExoTrackSelection[] selections,
    @Nullable Object info
)

This method is deprecated.

Use TrackSelectorResult.

TrackSelectorResult(
    @NullableType RendererConfiguration[] rendererConfigurations,
    @NullableType ExoTrackSelection[] selections,
    Tracks tracks,
    @Nullable Object info
)

Public methods

boolean

Returns whether this result is equivalent to other for all renderers.

boolean

Returns whether this result is equivalent to other for the renderer at the given index.

boolean
isRendererEnabled(int index)

Returns whether the renderer at the specified index is enabled.

Public fields

info

public final @Nullable Object info

An opaque object that will be returned to onSelectionActivated should the selections be activated.

length

public final int length

The number of selections in the result. Greater than or equal to zero.

rendererConfigurations

@NullableType
public final RendererConfiguration[] rendererConfigurations

A RendererConfiguration for each renderer. A null entry indicates the corresponding renderer should be disabled.

selections

@NullableType
public final ExoTrackSelection[] selections

A ExoTrackSelection array containing the track selection for each renderer.

tracks

public final Tracks tracks

Describe the tracks and which one were selected.

Public constructors

TrackSelectorResult

public TrackSelectorResult(
    @NullableType RendererConfiguration[] rendererConfigurations,
    @NullableType ExoTrackSelection[] selections,
    @Nullable Object info
)
Parameters
@NullableType RendererConfiguration[] rendererConfigurations

A RendererConfiguration for each renderer. A null entry indicates the corresponding renderer should be disabled.

@NullableType ExoTrackSelection[] selections

A ExoTrackSelection array containing the selection for each renderer.

@Nullable Object info

An opaque object that will be returned to onSelectionActivated should the selection be activated. May be null.

TrackSelectorResult

public TrackSelectorResult(
    @NullableType RendererConfiguration[] rendererConfigurations,
    @NullableType ExoTrackSelection[] selections,
    Tracks tracks,
    @Nullable Object info
)
Parameters
@NullableType RendererConfiguration[] rendererConfigurations

A RendererConfiguration for each renderer. A null entry indicates the corresponding renderer should be disabled.

@NullableType ExoTrackSelection[] selections

A ExoTrackSelection array containing the selection for each renderer.

Tracks tracks

Description of the available tracks and which one were selected.

@Nullable Object info

An opaque object that will be returned to onSelectionActivated should the selection be activated. May be null.

Public methods

isEquivalent

public boolean isEquivalent(@Nullable TrackSelectorResult other)

Returns whether this result is equivalent to other for all renderers.

Parameters
@Nullable TrackSelectorResult other

The other TrackSelectorResult. May be null, in which case false will be returned.

Returns
boolean

Whether this result is equivalent to other for all renderers.

isEquivalent

public boolean isEquivalent(@Nullable TrackSelectorResult other, int index)

Returns whether this result is equivalent to other for the renderer at the given index. The results are equivalent if they have equal track selections and configurations for the renderer.

Parameters
@Nullable TrackSelectorResult other

The other TrackSelectorResult. May be null, in which case false will be returned.

int index

The renderer index to check for equivalence.

Returns
boolean

Whether this result is equivalent to other for the renderer at the specified index.

isRendererEnabled

public boolean isRendererEnabled(int index)

Returns whether the renderer at the specified index is enabled.