Mac Video Player State
macOS implementation of the video player state.
Handles media playback through a native AVFoundation player (via MacNativeBridge).
The architecture intentionally mirrors the Windows implementation 1:1 so the two platforms behave identically: a producer/consumer coroutine pair drives frames through a single-slot drop-oldest Channel, frames are deduplicated by content hash, triple-buffered Skia bitmaps avoid tearing, and the playback position is derived from each frame's timestamp rather than a separate polling loop. The one place macOS deliberately diverges is the aspect ratio: it uses AVFoundation's display aspect ratio (pixel-aspect-ratio / clean-aperture corrected) so anamorphic content renders correctly — see displayAspectRatio.
Properties
Returns the total duration of the video as a formatted string.
Callback invoked when playback reaches the end of the media. Only called when loop is false. May be invoked from a background thread.
Returns the current playback position as a formatted string.
Denotes whether the user is manually adjusting the playback position.
Functions
Clears the shared video cache, removing all cached media data from disk.
Opens a media file bundled with the application.
Opens a video file or URL for playback.
Commits the seek after a user-driven seek interaction. Performs the actual seek on the player and ends the dragging state.
Begins a user-driven seek interaction (e.g. slider drag). Updates the visual slider position without performing the actual seek on the player. Must be followed by seekFinished to commit the seek.