VideoStageScope

What content drawn over a VideoStage is given.

A BoxScope, so an overlay places itself with align and matchParentSize the way it would in any box. frame is the letterbox the stage already computed, which tells an overlay where the picture is.

A Row or a Column opened inside the content shadows this scope, so chrome that reads frame or aspect from inside one takes them as parameters.

VideoStage(player = player, outputAspect = outputAspect) {
CropOverlay(rect = rect, onRectChange = { rect = it })

Text(
text = "${(aspect * 100).roundToInt() / 100f}",
modifier = Modifier.align(Alignment.BottomEnd),
)
}

Properties

Link copied to clipboard
abstract val aspect: Float

Width over height of the frame the stage is showing, which is what a live preview reports while one is running and the aspect the stage was given otherwise. Zero before either is known.

Link copied to clipboard
abstract val frame: CropFrame

Where the video is drawn, in the stage's own coordinate space, and the mapping between that and a normalized rectangle.

Functions

Link copied to clipboard
abstract fun Modifier.align(alignment: Alignment): Modifier
Link copied to clipboard
fun VideoStageScope.CropOverlay(rect: NormalizedRect, onRectChange: (NormalizedRect) -> Unit, modifier: Modifier = Modifier, constraint: CropConstraint = CropOverlayDefaults.Constraint, colors: CropColors = CropOverlayDefaults.Palette, handleLength: Dp = CropOverlayDefaults.HandleLength, touchSize: Dp = CropOverlayDefaults.TouchSize, showGrid: Boolean = true)

A drag-to-crop rectangle over the video a dev.jordond.filmstrip.compose.ui.VideoStage is showing.

Link copied to clipboard
Link copied to clipboard
fun VideoStageScope.OverlayHandle(placement: OverlayPlacement, onFrameAnchorChange: (Anchor) -> Unit, output: Size, modifier: Modifier = Modifier, colors: OverlayHandleColors = OverlayHandleDefaults.Palette, handleLength: Dp = OverlayHandleDefaults.HandleLength, enabled: Boolean = true, content: @Composable () -> Unit = { })

A draggable box over the video a VideoStage is showing, drawn where the overlay it stands for really lands.