PlayerSurface

Functions summary

Unit
@UnstableApi
@Composable
PlayerSurface(
    player: Player?,
    modifier: Modifier,
    surfaceType: @SurfaceType Int
)

Provides a dedicated drawing android.view.Surface for media playbacks using a Player.

Functions

@UnstableApi
@Composable
fun PlayerSurface(
    player: Player?,
    modifier: Modifier = Modifier,
    surfaceType: @SurfaceType Int = SURFACE_TYPE_SURFACE_VIEW
): Unit

Provides a dedicated drawing android.view.Surface for media playbacks using a Player.

The player's video output is displayed with either a android.view.SurfaceView or a android.view.TextureView.

Player takes care of attaching the rendered output to the android.view.Surface and clearing it, when it is destroyed.

See Choosing a surface type for more information.