VideoPlayerSurface

fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit, surfaceType: SurfaceType = SurfaceType.Auto, overlay: @Composable () -> Unit = {})
fun VideoPlayerSurface(playerState: RenderableVideoPlayerState, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit, surfaceType: SurfaceType = SurfaceType.Auto, overlay: @Composable () -> Unit = {})


actual fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier, contentScale: ContentScale, overlay: () -> Unit)

Renders a video player surface that displays and controls video playback.

Parameters

playerState

A library-backed or preview VideoPlayerState. Passing a custom state that has no platform video implementation fails with a descriptive error.

modifier

The modifier to be applied to the video player surface for layout and styling adjustments.

contentScale

Controls how the video content should be scaled inside the surface. This affects how the video is displayed when its dimensions don't match the surface dimensions.

overlay

Optional composable content to be displayed on top of the video surface. This can be used to add custom controls, information, or any UI elements.

fun VideoPlayerSurface(playerState: RenderableVideoPlayerState, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit, overlay: @Composable () -> Unit = {})

Type-safe overload for library-created player states. The legacy VideoPlayerState overload remains available for source and binary compatibility with the 1.x API.


expect fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit, overlay: @Composable () -> Unit = {})

Renders a video player surface that displays and controls video playback.

Parameters

playerState

A library-backed or preview VideoPlayerState. Passing a custom state that has no platform video implementation fails with a descriptive error.

modifier

The modifier to be applied to the video player surface for layout and styling adjustments.

contentScale

Controls how the video content should be scaled inside the surface. This affects how the video is displayed when its dimensions don't match the surface dimensions.

overlay

Optional composable content to be displayed on top of the video surface. This can be used to add custom controls, information, or any UI elements.

actual fun VideoPlayerSurface(playerState: ERROR CLASS: Symbol not found for VideoPlayerState, modifier: ERROR CLASS: Symbol not found for Modifier, contentScale: ERROR CLASS: Symbol not found for ContentScale, overlay: () -> Unit)
actual fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier, contentScale: ContentScale, overlay: () -> Unit)

Composable function for rendering a video player surface.

The function delegates the rendering logic to specific platform-specific implementations based on the type of the delegate within the provided VideoPlayerState.

Parameters

playerState

The current state of the video player, encapsulating playback state and platform-specific implementation details.

modifier

A Modifier for styling or adjusting the layout of the video player surface.

contentScale

Controls how the video content should be scaled inside the surface. This affects how the video is displayed when its dimensions don't match the surface dimensions.

overlay

Optional composable content to be displayed on top of the video surface. This can be used to add custom controls, information, or any UI elements.

actual fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier, contentScale: ContentScale, overlay: () -> Unit)

Renders a video player surface that displays and controls video playback.

Parameters

playerState

A library-backed or preview VideoPlayerState. Passing a custom state that has no platform video implementation fails with a descriptive error.

modifier

The modifier to be applied to the video player surface for layout and styling adjustments.

contentScale

Controls how the video content should be scaled inside the surface. This affects how the video is displayed when its dimensions don't match the surface dimensions.

overlay

Optional composable content to be displayed on top of the video surface. This can be used to add custom controls, information, or any UI elements.