PlatformVideoPlayerState

Defines a platform-specific video player state interface, providing the essential properties and operations needed for video playback management.

The interface is intended to be implemented by platform-specific classes, acting as a layer to abstract the underlying behavior of video players across different operating systems.

Properties:

  • isPlaying: Read-only property indicating whether the video is currently playing.

  • volume: Controls the playback volume, with values between 0.0 (mute) and 1.0 (full volume).

  • sliderPos: Represents the current playback position as a normalized value between 0.0 and 1.0.

  • userDragging: Tracks if the user is currently interacting with the playback position control.

  • loop: Specifies whether the video playback should loop continuously.

  • leftLevel: Read-only property giving the audio peak level of the left channel.

  • rightLevel: Read-only property giving the audio peak level of the right channel.

  • positionText: Provides a formatted text representation of the current playback position.

  • durationText: Provides a formatted text representation of the total duration of the video.

Methods:

  • openUri(uri: String): Opens a video resource (file or URL) for playback.

  • play(): Begins or resumes video playback.

  • pause(): Pauses the current video playback.

  • stop(): Stops playback and resets the playback position to the beginning.

  • seekTo(value: Float): Seeks to a specific playback position based on the given normalized value.

  • dispose(): Releases resources and performs cleanup for the video player instance.

Inheritors

Properties

Link copied to clipboard
abstract val durationText: String
Link copied to clipboard
abstract val error: VideoPlayerError?
Link copied to clipboard
abstract val hasMedia: Boolean
Link copied to clipboard
abstract val isLoading: Boolean
Link copied to clipboard
abstract val isPlaying: Boolean
Link copied to clipboard
abstract val leftLevel: Float
Link copied to clipboard
abstract var loop: Boolean
Link copied to clipboard
abstract val metadata: VideoMetadata
Link copied to clipboard
abstract val positionText: String
Link copied to clipboard
abstract val rightLevel: Float
Link copied to clipboard
abstract var sliderPos: Float
Link copied to clipboard
abstract var userDragging: Boolean
Link copied to clipboard
abstract var volume: Float

Functions

Link copied to clipboard
abstract fun clearError()
Link copied to clipboard
abstract fun dispose()
Link copied to clipboard
abstract fun openUri(uri: String)
Link copied to clipboard
abstract fun pause()
Link copied to clipboard
abstract fun play()
Link copied to clipboard
abstract fun seekTo(value: Float)
Link copied to clipboard
abstract fun stop()