MediaSurfaceContainer

Hosts a platform-native video surface and binds the resulting com.splendo.kaluga.media.MediaSurface to binder (via MediaSurfaceBinder.bind); the surface is detached (MediaSurfaceBinder.unbind) on composition exit. Obtain binder from MediaPlayer.surfaceBinder.

expect fun MediaSurfaceContainer(binder: MediaSurfaceBinder, modifier: Modifier = Modifier)

Hosts a platform-native video surface and binds the resulting com.splendo.kaluga.media.MediaSurface to binder (via MediaSurfaceBinder.bind); the surface is detached (MediaSurfaceBinder.unbind) on composition exit. Obtain binder from MediaPlayer.surfaceBinder.

Hosts a platform-native video surface and binds the resulting com.splendo.kaluga.media.MediaSurface to binder (via MediaSurfaceBinder.bind); the surface is detached (MediaSurfaceBinder.unbind) on composition exit. Obtain binder from MediaPlayer.surfaceBinder.

Hosts a platform-native video surface and binds the resulting com.splendo.kaluga.media.MediaSurface to binder (via MediaSurfaceBinder.bind); the surface is detached (MediaSurfaceBinder.unbind) on composition exit. Obtain binder from MediaPlayer.surfaceBinder.

MacOS implementation — currently a placeholder as CMP for MacOs does not support interop with NSView.

Web implementation. Compose Multiplatform renders to a <canvas>, so the player's <video> element cannot live inside the Compose tree. Instead this hosts a DOM container positioned (via onGloballyPositioned) to overlay the area this composable occupies, and binds it as the MediaSurface; the container — and the video the MediaManager appends to it — is removed on composition exit. Positions are in CSS pixels, converted from Compose pixels through the current density.

The container sits behind the Compose canvas, and this composable clears its own rectangle to transparent (BlendMode.Clear) so the video shows through that hole. Everything Compose draws after the surface — controls, overlays, dialogs — therefore composites on top of the video instead of being hidden behind a DOM element painted over the canvas.