PlayerSurface

fun PlayerSurface(player: Player, modifier: Modifier = Modifier, scaleMode: ScaleMode = ScaleMode.Fit, contentAlignment: Alignment = Alignment.Center, defaultAspectRatio: Float? = null, displayDebugView: Boolean = false, surfaceType: SurfaceType = SurfaceType.Surface, surfaceContent: @Composable BoxScope.() -> Unit? = { ExoPlayerSubtitleView(player = player) })

A Composable function that displays a Player.

It supports different surface type, scaling modes, and allows for custom content to be laid on top of the Player.

Parameters

player

The Player instance to use for playback.

modifier

The Modifier to apply to the layout.

scaleMode

The scaling mode to use.

contentAlignment

The "letterboxing" content alignment inside the parent.

defaultAspectRatio

The default aspect ratio to use while the video is loading, or for audio content.

displayDebugView

Whether to display a debug view showing video size and aspect ratio information. Defaults to false.

surfaceType

The type of surface to use for rendering the video.

surfaceContent

The content to display on top of the Player.