Package-level declarations

Types

Link copied to clipboard
@UnstableApi
class AudioLevelProcessor : BaseAudioProcessor
DefaultVideoPlayerState
Link copied to clipboard
@UnstableApi
@Stable
open class DefaultVideoPlayerState : VideoPlayerState

Represents the state and behavior of a video player. This class provides properties and methods to control video playback, manage the playback state, and interact with platform-specific implementations.

Implementation of VideoPlayerState for WebAssembly/JavaScript platform. Manages the state of a video player including playback controls, media information, and error handling.

Link copied to clipboard

Manages fullscreen functionality for the video player

Link copied to clipboard

Represents the initial state of the player after opening a media file or URI.

Link copied to clipboard
data class PreviewableVideoPlayerState(val hasMedia: Boolean = true, val isPlaying: Boolean = true, val isLoading: Boolean = false, var volume: Float = 1.0f, var sliderPos: Float = 500.0f, var userDragging: Boolean = false, var loop: Boolean = true, var playbackSpeed: Float = 1.0f, val leftLevel: Float = 1.0f, val rightLevel: Float = 1.0f, val positionText: String = "00:05", val durationText: String = "00:10", val currentTime: Double = 5000.0, var isFullscreen: Boolean = false, val aspectRatio: Float = 1.7f, val error: VideoPlayerError? = null, val metadata: VideoMetadata = VideoMetadata(), var subtitlesEnabled: Boolean = false, var currentSubtitleTrack: SubtitleTrack? = null, val availableSubtitleTracks: MutableList<SubtitleTrack> = emptyList<SubtitleTrack>().toMutableList(), var subtitleTextStyle: TextStyle = TextStyle.Default, var subtitleBackgroundColor: Color = Color.Transparent) : VideoPlayerState

Helper to mock the VideoPlayerState.

Link copied to clipboard
@Stable
data class SubtitleTrack(val label: String, val language: String, val src: String)
Link copied to clipboard
enum SurfaceType : Enum<SurfaceType>
Link copied to clipboard
@Stable
data class VideoMetadata(var title: String? = null, var duration: Long? = null, var width: Int? = null, var height: Int? = null, var bitrate: Long? = null, var frameRate: Float? = null, var mimeType: String? = null, var audioChannels: Int? = null, var audioSampleRate: Int? = null)

Represents metadata information of a video file.

Link copied to clipboard
sealed class VideoPlayerError

Represents different types of errors that can occur during video playback in a video player.

Link copied to clipboard
@Stable
interface VideoPlayerState

Represents the state and controls for a video player. This class provides properties and methods to manage video playback, including play, pause, stop, seeking, and more. It maintains information about the playback state, such as whether the video is currently playing, volume levels, and playback position.

Functions

Link copied to clipboard

Create platform-specific video player state. Supported platforms include Windows, macOS, and Linux.

actual fun createVideoPlayerState(): VideoPlayerState
Link copied to clipboard
fun openFullscreenView(playerState: <Error class: unknown class>, renderSurface: (<Error class: unknown class>, <Error class: unknown class>, Boolean) -> Unit)

Opens a fullscreen view for the video player on iOS. This function is called when the user toggles fullscreen mode.

Link copied to clipboard

Creates and manages an instance of VideoPlayerState within a composable function, ensuring proper disposal of the player state when the composable leaves the composition. This function is used to remember the video player state throughout the composition lifecycle.

Link copied to clipboard
@UnstableApi
@Composable
actual fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier, contentScale: ContentScale, overlay: () -> Unit)
@UnstableApi
@Composable
fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit, surfaceType: SurfaceType = SurfaceType.TextureView, overlay: @Composable () -> Unit = {})
@Composable
expect fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier = Modifier, contentScale: ContentScale = ContentScale.Fit, overlay: @Composable () -> Unit = {})

Renders a video player surface that displays and controls video playback.

actual fun VideoPlayerSurface(playerState: <Error class: unknown class>, modifier: <Error class: unknown class>, contentScale: <Error class: unknown class>, overlay: () -> Unit)
@Composable
actual fun VideoPlayerSurface(playerState: <Error class: unknown class>, modifier: Modifier, contentScale: ContentScale, overlay: @Composable () -> Unit)
@Composable
actual fun VideoPlayerSurface(playerState: VideoPlayerState, modifier: Modifier, contentScale: ContentScale, overlay: () -> Unit)

Composable function for rendering a video player surface.

@Composable
actual fun VideoPlayerSurface(playerState: <Error class: unknown class>, modifier: Modifier, contentScale: ContentScale, overlay: () -> Unit)
Link copied to clipboard
fun VideoPlayerSurfaceImpl(playerState: <Error class: unknown class>, modifier: <Error class: unknown class>, contentScale: <Error class: unknown class>, overlay: () -> Unit, isInFullscreenView: Boolean = false, pauseOnDispose: Boolean = true)
Link copied to clipboard
fun Modifier.videoRatioClip(videoRatio: Float?, contentScale: ContentScale = ContentScale.Fit): Modifier