Package-level declarations

Types

Link copied to clipboard
@RequiresOptIn(message = "This TV UI API is experimental and may change in future releases.", level = RequiresOptIn.Level.WARNING)
annotation class ExperimentalTvUiApi

Marks declarations that are part of the experimental THEOplayer Android TV UI API.

Link copied to clipboard
class SliderColors(val thumbColor: Color, val activeTrackColor: Color, val inactiveTrackColor: Color, val disabledThumbColor: Color, val disabledActiveTrackColor: Color, val disabledInactiveTrackColor: Color)

Colors used to draw a TV slider in enabled and disabled states.

Link copied to clipboard

Creates slider colors and default slider content.

Link copied to clipboard
class SliderState(value: Float = 0.0f, valueRange: ClosedFloatingPointRange<Float> = 0f..1f)

Holds the value and range for a TV slider.

Functions

Link copied to clipboard
fun AudioTrackList(modifier: Modifier = Modifier, onClick: () -> Unit? = null)
fun AudioTrackList(state: AudioTrackState, modifier: Modifier = Modifier, onClick: () -> Unit? = null)

A list of audio tracks, from which the user can choose an active audio track.

Link copied to clipboard

A menu to change the spoken language of the stream.

Link copied to clipboard
fun CurrentTimeDisplay(modifier: Modifier = Modifier, showRemaining: Boolean = false, showDuration: Boolean = false)
fun CurrentTimeDisplay(state: PlaybackTimeState, modifier: Modifier = Modifier, showRemaining: Boolean = false, showDuration: Boolean = false)

A text display that shows the player's current time.

Link copied to clipboard
fun DefaultUI(modifier: Modifier = Modifier, theoplayerView: THEOplayerView, title: String? = null)
fun DefaultUI(modifier: Modifier = Modifier, config: THEOplayerConfig, source: SourceDescription? = null, title: String? = null)

A default THEOplayer UI component for Android TV.

Link copied to clipboard
fun DurationDisplay(modifier: Modifier = Modifier)
fun DurationDisplay(state: PlaybackTimeState, modifier: Modifier = Modifier)

A text display that shows the player's duration.

Link copied to clipboard
fun ErrorDisplay(modifier: Modifier = Modifier)
fun ErrorDisplay(state: ErrorState, modifier: Modifier = Modifier)

A display for a fatal error, if the player encounters one.

Link copied to clipboard
fun MenuScope.LanguageMenu(audioTrackState: AudioTrackState, subtitleTrackState: SubtitleTrackState)

A menu to change the spoken language and subtitles of the stream.

Link copied to clipboard
fun MenuScope.LanguageMenuButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable () -> Unit = { Icon( painter = painterResource(id = CommonR.drawable.language), contentDescription = stringResource(CommonR.string.theoplayer_ui_menu_language), ) })
fun MenuScope.LanguageMenuButton(audioTrackState: AudioTrackState, subtitleTrackState: SubtitleTrackState, modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable () -> Unit = { Icon( painter = painterResource(id = CommonR.drawable.language), contentDescription = stringResource(CommonR.string.theoplayer_ui_menu_language), ) })

A button that opens the language menu.

Link copied to clipboard
fun LiveButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = ButtonDefaults.ContentPadding, colors: ButtonColors = ButtonDefaults.colors(), liveThreshold: Double = 10.0, live: @Composable RowScope.() -> Unit = { LiveButtonContent(LocalPlayerColors.current.liveButtonLive) }, dvr: @Composable RowScope.() -> Unit = { LiveButtonContent(LocalPlayerColors.current.liveButtonDvr) })
fun LiveButton(state: LiveButtonState, modifier: Modifier = Modifier, contentPadding: PaddingValues = ButtonDefaults.ContentPadding, colors: ButtonColors = ButtonDefaults.colors(), live: @Composable RowScope.() -> Unit = { LiveButtonContent(LocalPlayerColors.current.liveButtonLive) }, dvr: @Composable RowScope.() -> Unit = { LiveButtonContent(LocalPlayerColors.current.liveButtonDvr) })

A button that shows whether the player is currently playing at the live point, and seeks to the live point when clicked.

Link copied to clipboard
fun LoadingSpinner(modifier: Modifier = Modifier, color: Color = MaterialTheme.colorScheme.primary, strokeWidth: Dp = 4.dp, delay: Duration = LocalPlayerAnimations.current.loadingSpinnerDelay)
fun LoadingSpinner(state: LoadingState, modifier: Modifier = Modifier, color: Color = MaterialTheme.colorScheme.primary, strokeWidth: Dp = 4.dp, delay: Duration = LocalPlayerAnimations.current.loadingSpinnerDelay)

An indicator that shows whether the player is currently waiting for more data to resume playback.

Link copied to clipboard
fun MenuScope.Menu(modifier: Modifier = Modifier, title: @Composable () -> Unit, content: @Composable ColumnScope.() -> Unit)

A side menu displayed at the end edge of the player.

Link copied to clipboard
fun PlaybackRateList(modifier: Modifier = Modifier, playbackRates: List<Double> = defaultPlaybackRates, onClick: () -> Unit? = null)
fun PlaybackRateList(state: PlaybackRateState, modifier: Modifier = Modifier, playbackRates: List<Double> = defaultPlaybackRates, onClick: () -> Unit? = null)

A list of playback rates, from which the user can choose a desired playback rate.

Link copied to clipboard

A menu to change the playback rate of the player.

Link copied to clipboard
fun PlayButton(modifier: Modifier = Modifier, iconModifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), play: @Composable () -> Unit = { Icon( painter = painterResource(R.drawable.play), modifier = iconModifier, contentDescription = stringResource(R.string.theoplayer_ui_btn_play), ) }, pause: @Composable () -> Unit = { Icon( painter = painterResource(R.drawable.pause), modifier = iconModifier, contentDescription = stringResource(R.string.theoplayer_ui_btn_pause), ) }, replay: @Composable () -> Unit = { Icon( Icons.Rounded.Replay, modifier = iconModifier, contentDescription = stringResource(R.string.theoplayer_ui_btn_replay), ) })
fun PlayButton(state: PlayButtonState, modifier: Modifier = Modifier, iconModifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), play: @Composable () -> Unit = { Icon( painter = painterResource(R.drawable.play), modifier = iconModifier, contentDescription = stringResource(R.string.theoplayer_ui_btn_play), ) }, pause: @Composable () -> Unit = { Icon( painter = painterResource(R.drawable.pause), modifier = iconModifier, contentDescription = stringResource(R.string.theoplayer_ui_btn_pause), ) }, replay: @Composable () -> Unit = { Icon( Icons.Rounded.Replay, modifier = iconModifier, contentDescription = stringResource(R.string.theoplayer_ui_btn_replay), ) })

A button that toggles whether the player is playing or paused.

Link copied to clipboard
fun QualityList(modifier: Modifier = Modifier, onClick: () -> Unit? = null)
fun QualityList(state: VideoQualityState, modifier: Modifier = Modifier, onClick: () -> Unit? = null)

A list of video qualities, from which the user can choose a target video quality.

Link copied to clipboard

A menu to change the video quality of the stream.

Link copied to clipboard
fun SeekBar(modifier: Modifier = Modifier, colors: SliderColors = SliderDefaults.colors(), seekOffset: Int = 10)

A seek bar showing the player's current time and allowing D-pad seeking.

fun SeekBar(state: SeekBarState, modifier: Modifier = Modifier, colors: SliderColors = SliderDefaults.colors(), seekOffset: Int = 10)

A seek bar showing the current time from state and allowing D-pad seeking.

Link copied to clipboard
fun SeekButton(modifier: Modifier = Modifier, seekOffset: Int = 10, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable () -> Unit)
fun SeekButton(modifier: Modifier = Modifier, seekOffset: Int = 10, iconSize: Dp = 24.dp, contentPadding: PaddingValues = PaddingValues(0.dp))
fun SeekButton(state: SeekButtonState, modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable () -> Unit)

A button that seeks forward or backward by a fixed offset.

Link copied to clipboard
fun MenuScope.SettingsMenu(videoQualityState: VideoQualityState, playbackRateState: PlaybackRateState)

A menu to change the settings of the player, such as video quality or playback rate.

Link copied to clipboard
fun MenuScope.SettingsMenuButton(modifier: Modifier = Modifier, contentPadding: PaddingValues = PaddingValues(0.dp), content: @Composable () -> Unit = { Icon( Icons.Rounded.Settings, contentDescription = stringResource(CommonR.string.theoplayer_ui_menu_settings), ) })

A button that opens the settings menu.

Link copied to clipboard
fun Slider(state: SliderState, onValueChange: (Float) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, keyStep: Float = (state.valueRange.endInclusive - state.valueRange.start) / 100f, keyRepeatStep: Float = keyStep, onValueChangeFinished: () -> Unit? = null, colors: SliderColors = SliderDefaults.colors(), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, thumb: @Composable (SliderState) -> Unit = { SliderDefaults.Thumb( interactionSource = interactionSource, colors = colors, enabled = enabled, ) }, track: @Composable (SliderState) -> Unit = { sliderState -> SliderDefaults.Track(sliderState = sliderState, colors = colors, enabled = enabled) })

Displays a slider backed by state and controlled by D-pad keys.

fun Slider(value: Float, onValueChange: (Float) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, valueRange: ClosedFloatingPointRange<Float> = 0f..1f, keyStep: Float = (valueRange.endInclusive - valueRange.start) / 100f, keyRepeatStep: Float = keyStep, onValueChangeFinished: () -> Unit? = null, colors: SliderColors = SliderDefaults.colors(), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, thumb: @Composable (SliderState) -> Unit = { SliderDefaults.Thumb( interactionSource = interactionSource, colors = colors, enabled = enabled, ) }, track: @Composable (SliderState) -> Unit = { sliderState -> SliderDefaults.Track(sliderState = sliderState, colors = colors, enabled = enabled) })

Displays a focusable slider controlled by D-pad keys.

Link copied to clipboard

A menu to change the subtitles of the stream.

Link copied to clipboard
fun SubtitleTrackList(modifier: Modifier = Modifier, onClick: () -> Unit? = null)
fun SubtitleTrackList(state: SubtitleTrackState, modifier: Modifier = Modifier, onClick: () -> Unit? = null)

A list of subtitle tracks, from which the user can choose an active subtitle track.

Link copied to clipboard

A menu to change the style of the subtitles, such as the font family, the font color or the background color.

Link copied to clipboard
fun UIController(modifier: Modifier = Modifier, theoplayerView: THEOplayerView, color: Color = Color.Black.copy(alpha = 0.5f), 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)
fun UIController(modifier: Modifier = Modifier, config: THEOplayerConfig, source: SourceDescription? = null, color: Color = Color.Black.copy(alpha = 0.5f), 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 TV-oriented UI controller for a THEOplayer view.