UIController

fun UIController(modifier: Modifier = Modifier, config: THEOplayerConfig, source: SourceDescription? = null, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, color: Color = Color.Black, centerOverlay: @Composable UIControllerScope.() -> Unit? = null, errorOverlay: @Composable UIControllerScope.() -> Unit? = null, topChrome: @Composable UIControllerScope.() -> Unit? = null, centerChrome: @Composable UIControllerScope.() -> Unit? = null, bottomChrome: @Composable UIControllerScope.() -> Unit? = null)

A container component for a THEOplayer UI.

This component provides a basic layout structure for a player UI, and handles the creation and management of a Player instance for this UI.

The colors and fonts can be changed by wrapping this inside a THEOplayerTheme.

Parameters

modifier

the Modifier to be applied to this container

config

the player configuration to be used when constructing the THEOplayerView

source

the source description to load into the player

interactionSource

the MutableInteractionSource representing the stream of Interactions for this container. You can create and pass in your own remembered instance to observe Interactions and customize the behavior of this container.

color

the background color for the overlay while showing the UI controls

centerOverlay

content to show in the center of the player, typically a LoadingSpinner.

errorOverlay

content to show when the player encountered a fatal error, typically an ErrorDisplay.

topChrome

controls to show at the top of the player, for example the stream's title.

centerChrome

controls to show in the center of the player, for example a large PlayButton.

bottomChrome

controls to show at the bottom of the player, for example a SeekBar or a Row containing a MuteButton and a FullscreenButton.


fun UIController(modifier: Modifier = Modifier, player: Player = rememberPlayer(), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, color: Color = Color.Black, centerOverlay: @Composable UIControllerScope.() -> Unit? = null, errorOverlay: @Composable UIControllerScope.() -> Unit? = null, topChrome: @Composable UIControllerScope.() -> Unit? = null, centerChrome: @Composable UIControllerScope.() -> Unit? = null, bottomChrome: @Composable UIControllerScope.() -> Unit? = null)

A container component for a THEOplayer UI.

This component provides a basic layout structure for a player UI using the given player.

The colors and fonts can be changed by wrapping this inside a THEOplayerTheme.

Parameters

modifier

the Modifier to be applied to this container

player

the player. This should always be created using rememberPlayer.

interactionSource

the MutableInteractionSource representing the stream of Interactions for this container. You can create and pass in your own remembered instance to observe Interactions and customize the behavior of this container.

color

the background color for the overlay while showing the UI controls

centerOverlay

content to show in the center of the player, typically a LoadingSpinner.

errorOverlay

content to show when the player encountered a fatal error, typically an ErrorDisplay.

topChrome

controls to show at the top of the player, for example the stream's title.

centerChrome

controls to show in the center of the player, for example a large PlayButton.

bottomChrome

controls to show at the bottom of the player, for example a SeekBar or a Row containing a MuteButton and a FullscreenButton.