CastTrackSelector
@UnstableApi
abstract class CastTrackSelector
Handles track selections and parameter changes for RemoteCastPlayer.
See evaluate for the most important uses of this class.
An instance of this class must not be reused across different RemoteCastPlayer instances. A new instance must be created for each player.
Summary
Nested types |
|---|
|
Holds parameters associated with a |
|
The result of a |
|
A builder for |
@DocumentedThe reason for track selection request. |
Constants |
|
|---|---|
const Int |
The selection request is the result of a call to |
const Int |
The selection request is the result of a call to |
const Int |
The selection request is the result of an update from the Cast receiver app. |
Protected constructors |
|---|
|
Constructor. |
Public functions |
|
|---|---|
abstract CastTrackSelector.CastTrackSelectorResult! |
Called by |
Unit |
Triggers a new call to |
Constants
TRACK_SELECTION_REQUEST_REASON_INVALIDATION
const val TRACK_SELECTION_REQUEST_REASON_INVALIDATION = 0: Int
The selection request is the result of a call to invalidate.
TRACK_SELECTION_REQUEST_REASON_PARAMETER_CHANGE
const val TRACK_SELECTION_REQUEST_REASON_PARAMETER_CHANGE = 2: Int
The selection request is the result of a call to setTrackSelectionParameters.
TRACK_SELECTION_REQUEST_REASON_RECEIVER_UPDATE
const val TRACK_SELECTION_REQUEST_REASON_RECEIVER_UPDATE = 1: Int
The selection request is the result of an update from the Cast receiver app.
Protected constructors
Public functions
evaluate
abstract fun evaluate(request: CastTrackSelector.CastTrackSelectorRequest!): CastTrackSelector.CastTrackSelectorResult!
Called by RemoteCastPlayer to optionally change the current track selections and/or parameters.
You can implement this method to change the currently active tracks through selections. For example, in response to a change in the current track selection parameters, available through trackSelectionParameters.
Alternatively, you can also change the current track selection parameters in response to a receiver app track selection change.
You can trigger a call to this method by calling invalidate, or by changing the track selection parameters.
| Parameters | |
|---|---|
request: CastTrackSelector.CastTrackSelectorRequest! |
The |
| Returns | |
|---|---|
CastTrackSelector.CastTrackSelectorResult! |
A |
invalidate
fun invalidate(): Unit
Triggers a new call to evaluate, so as to change the selected tracks.
Must be called on the main thread.