androidx.media3.cast


Interfaces

CastPlayer.TransferCallback

Callback for moving state across players when transferring playback upon Cast session availability changes.

MediaItemConverter

Converts between MediaItem and the Cast SDK's MediaQueueItem.

SessionAvailabilityListener

Listener of changes in the cast session availability.

Classes

Cast

The primary entry point for interacting with the Cast context.

CastPlayer

Player implementation that can control playback both on the local device, and on a remote Cast device.

CastPlayer.Builder

Builder for CastPlayer.

CastTrackSelector

Handles track selections and parameter changes for RemoteCastPlayer.

CastTrackSelector.CastTrackSelectorRequest

Holds parameters associated with a evaluation request.

CastTrackSelector.CastTrackSelectorResult

The result of a track selection.

CastTrackSelector.CastTrackSelectorResult.Builder

A builder for CastTrackSelectorResult.

DefaultCastOptionsProvider

A convenience OptionsProvider to target the default cast receiver app.

DefaultMediaItemConverter

Default MediaItemConverter implementation.

MediaRouteButtonFactory

A factory class to set up a media route button.

MediaRouteButtonViewProvider

A provider of a media route button view to be displayed in the player UI.

RemoteCastPlayer

Player implementation that communicates with a Cast receiver app.

RemoteCastPlayer.Builder

A builder for RemoteCastPlayer instances.

Annotations

CastTrackSelector.TrackSelectionRequestReason

The reason for track selection request.

Top-level functions summary

Unit

A Material3 IconButton that displays a media route button.

Top-level functions

MediaRouteButton

@MainThread
@UnstableApi
@Composable
fun MediaRouteButton(modifier: Modifier = Modifier): Unit

A Material3 IconButton that displays a media route button.

Clicking the button displays the route chooser dialog for transferring media or the route controller dialog to control the remote playback. The default behavior prioritizes launching the system's route chooser / controller dialog if available and falls back to an in-app dialog otherwise.

The button's tint color can be customized by providing a LocalContentColor in the composition hierarchy.

 CompositionLocalProvider(LocalContentColor provides Color.Blue) {
MediaRouteButton(modifier = modifier)
}
Parameters
modifier: Modifier = Modifier

the Modifier to be applied to the button.

Throws
IllegalStateException

if any of the following condition occurs: - This method is not called on the main thread. - The Cast has not been initialized via Cast.initialize() before this method is called.