ExoPlayerView

fun ExoPlayerView(player: Player, modifier: Modifier = Modifier, useController: Boolean = true, controllerAutoShow: Boolean = true, showNextButton: Boolean = true, showPreviousButton: Boolean = true, showBuffering: @PlayerView.ShowBuffering Int = PlayerView.SHOW_BUFFERING_NEVER, resizeMode: @AspectRatioFrameLayout.ResizeMode Int = AspectRatioFrameLayout.RESIZE_MODE_FIT, errorMessageProvider: ErrorMessageProvider<PlaybackException>? = null, fullScreenListener: PlayerView.FullscreenButtonClickListener? = null, controllerVisibilityListener: PlayerView.ControllerVisibilityListener? = null, @ColorInt shutterBackgroundColor: Int = 0)

A Composable function that displays an ExoPlayer PlayerView.

Parameters

player

The Player instance to be attached to the PlayerView.

modifier

The Modifier to apply to this layout.

useController

Whether to display playback controls.

controllerAutoShow

Whether the controls should be shown automatically when the playback starts, pauses, ends or fails.

showNextButton

Whether to display the "next" button in the controller.

showPreviousButton

Whether to display the "previous" button in the controller.

showBuffering

Specifies when to display the buffering indicator.

resizeMode

Specifies how the video content should be resized to fit the PlayerView.

errorMessageProvider

An optional ErrorMessageProvider to customize error messages displayed during playback failures.

fullScreenListener

An optional PlayerView.FullscreenButtonClickListener to handle clicks on the fullscreen button.

controllerVisibilityListener

An optional PlayerView.ControllerVisibilityListener to receive callbacks when the controller's visibility changes.

shutterBackgroundColor

The color of the shutter (background) when the video is not playing.

See also