MediaRouteButton

Functions summary

Unit

A Material3 IconButton that displays a media route button.

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.