androidx.media3.ui.compose.material3

Top-level functions summary

Unit
@UnstableApi
@Composable
Player(player: Player?, modifier: Modifier)

A composable that provides a basic player UI layout, combining a ContentFrame for displaying player content with customizable controls and a shutter.

Unit
@ExperimentalApi
@Composable
Player(
    player: Player?,
    modifier: Modifier,
    surfaceType: @SurfaceType Int,
    contentScale: ContentScale,
    keepContentOnReset: Boolean,
    shutter: @Composable () -> Unit,
    showControls: Boolean,
    topControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)?,
    centerControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)?,
    bottomControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)?
)

A composable that provides a basic player UI layout, combining a ContentFrame for displaying player content with customizable controls and a shutter.

Top-level functions

@UnstableApi
@Composable
fun Player(player: Player?, modifier: Modifier = Modifier): Unit

A composable that provides a basic player UI layout, combining a ContentFrame for displaying player content with customizable controls and a shutter.

This composable consists of a ContentFrame that handles the rendering of the player's video, overlaid with some default controls and a shutter.

Parameters
player: Player?

The Player instance to be controlled and whose content is displayed.

modifier: Modifier = Modifier

The Modifier to be applied to the outer Box.

@ExperimentalApi
@Composable
fun Player(
    player: Player?,
    modifier: Modifier = Modifier,
    surfaceType: @SurfaceType Int = SURFACE_TYPE_SURFACE_VIEW,
    contentScale: ContentScale = ContentScale.Fit,
    keepContentOnReset: Boolean = false,
    shutter: @Composable () -> Unit = { PlayerDefaults.Shutter() },
    showControls: Boolean = true,
    topControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)? = defaultTopControls,
    centerControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)? = defaultCenterControls,
    bottomControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)? = defaultBottomControls
): Unit

A composable that provides a basic player UI layout, combining a ContentFrame for displaying player content with customizable controls and a shutter.

This composable is designed to be a flexible container for building player interfaces. It consists of a ContentFrame that handles the rendering of the player's video, overlaid with optional controls and a shutter.

Parameters
player: Player?

The Player instance to be controlled and whose content is displayed.

modifier: Modifier = Modifier

The Modifier to be applied to the outer Box.

surfaceType: @SurfaceType Int = SURFACE_TYPE_SURFACE_VIEW

The type of surface to use for video rendering. See SurfaceType.

contentScale: ContentScale = ContentScale.Fit

The scaling mode to apply to the content within the ContentFrame.

keepContentOnReset: Boolean = false

Whether to keep the content visible when the player is reset.

shutter: @Composable () -> Unit = { PlayerDefaults.Shutter() }

A composable to be displayed as a shutter over the content. The default shutter is a black Box.

showControls: Boolean = true

Whether the controls should be visible.

topControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)? = defaultTopControls

A composable aligned with Alignment.TopCenter, receiving the player and showControls.

centerControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)? = defaultCenterControls

A composable aligned with Alignment.Center, receiving the player and showControls.

bottomControls: (@Composable BoxScope.(Player?, Boolean) -> Unit)? = defaultBottomControls

A composable aligned with Alignment.BottomCenter, receiving the player and showControls.