Video Player State
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 of this class are tied to managing and interacting with the underlying video player implementation.
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.
The actual implementation delegates its behavior to platform-specific video player states based on the detected operating system. Supported platforms include Windows, macOS, and Linux.
Properties:
isPlaying: Indicates whether the video is currently playing.volume: Controls the playback volume. Valid values are within the range of 0.0 (muted) to 1.0 (maximum volume).sliderPos: Represents the current playback position as a normalized value between 0.0 and 1.0.userDragging: Denotes whether the user is manually adjusting the playback position.loop: Specifies if the video should loop when it reaches the end.leftLevel: Provides the audio level for the left channel as a percentage.rightLevel: Provides the audio level for the right channel as a percentage.positionText: Returns the current playback position as a formatted string.durationText: Returns the total duration of the video as a formatted string.
Methods:
openUri(uri: String): Opens a video file or URL for playback.play(): Starts or resumes video playback.pause(): Pauses video playback.stop(): Stops playback and resets the player state.seekTo(value: Float): Seeks to a specific playback position based on the provided normalized value.dispose(): Releases resources used by the video player and disposes of the state.
Implementation of VideoPlayerState for WebAssembly/JavaScript platform. Manages the state of a video player including playback controls, media information, and error handling.
Constructors
Properties
Callback to apply playback speed changes to the underlying media player
Callback to apply volume changes to the underlying media player
Callback function to force recalculation of the HTML view position. This is set by the VideoPlayerSurface when the HTML view is created.
Functions
Clears any error state.
Disables subtitle display.
Disables subtitles by clearing the current track and setting subtitlesEnabled to false.
Forces recalculation of the HTML view position. This is useful when the layout changes and the HTML view needs to be repositioned.
Callback for time update events from the media player.
Opens a media file.
Opens a media source from the given URI.
Opens a media source from the given URI.
Selects a subtitle track for display. If track is null, disables subtitles.
Selects a subtitle track and enables subtitles.
Toggles the fullscreen state of the video player
Toggles the fullscreen state of the video player
Updates the audio level indicators.
Updates the position and duration display.