OGPlayerView

fun OGPlayerView(player: OGPlayer, modifier: Modifier = Modifier, uiConfig: OGUiConfig = OGUiConfig.DEFAULT, fullscreenHandler: FullscreenHandler? = null, overlays: Map<OverlaySlot, @Composable () -> Unit> = emptyMap(), overlayOffsets: Map<OverlaySlot, DpOffset> = emptyMap(), startInFullscreen: Boolean = false, autoFullscreenOnRotate: Boolean = false, doubleTapToSeek: Boolean = true, onFullscreenExitRequest: () -> Unit? = null, customControls: @Composable () -> Unit? = null)

Composable video surface with the SDK's playback controls overlaid. Tap toggles controls visibility; controls auto-hide while playing.

A fullscreen button is shown only when fullscreenHandler is provided; entering/exiting fullscreen presentation is the host app's responsibility. With startInFullscreen the handler is invoked once on first composition so playback opens directly in fullscreen.

overlays places app composables (watermarks, logos) in a 3x3 grid of slots; overlayOffsets nudges a slot's content by an exact dp offset from its anchor, giving free coordinate placement. Both are regular Compose state: passing different values (e.g. moving a watermark to another slot) repositions the overlay instantly, mid-playback. Overlays are hidden automatically while an ad break plays.

customControls replaces the built-in control layout entirely: the SDK still renders video, subtitles, ads, and the error overlay, while the app's composable draws its own controls on top using the public OGPlayer API. Visibility handling is then the app's responsibility.

With autoFullscreenOnRotate, device rotation drives fullscreen: turning to landscape invokes FullscreenHandler.onEnterFullscreen, back to portrait invokes FullscreenHandler.onExitFullscreen. For rotation to be fully bidirectional the handler must not leave requestedOrientation permanently locked. ActivityFullscreenHandler handles this: its button-driven orientation locks release automatically once the device is physically aligned, so rotation and the button compose cleanly.