video library

Video player, exporter and probe.

Classes

MethodChannelXVideoPlayerBackend
Production XVideoPlayerBackend. Hand-rolled MethodChannel + EventChannel — matches the rest of package:ux, no pigeon.
XDurationRange
One contiguous range of buffered playback time. Matches the shape package:video_player exposes today so call sites that read it (gallery scrub bar) port mechanically.
XVideoExporter
Trim / mute video export over the platform media pipelines — AVFoundation on Apple platforms (passthrough remux when no re-encode is needed), Media3 Transformer on Android, and Media Foundation on Windows, which re-encodes every request.
XVideoExportRequest
Parameters for one export. Null trim bounds keep the source's start/end; removeAudio drops the audio track entirely (mute).
XVideoExportResult
Metadata of a finished export.
XVideoExportSession
A running export. progress is best-effort (platform reporting granularity differs); done is authoritative.
XVideoPlayerBackend
Backend contract that XVideoPlayerController dispatches into. The default implementation calls into native code via the ux/video / ux/video/events channels; tests substitute their own (see package:ux/testing.dart's FakeXVideoPlayerBackend).
XVideoPlayerCompleted
Fired when playback hits the end of the media. Loop-mode is observed natively, so the controller only sees this event when playback truly stops at the tail.
XVideoPlayerController
Owns one native video-player session. The surface mirrors the subset of package:video_player's VideoPlayerController the app currently uses — the .file(...) / .network(...) constructors, the standard playback controls, and the value getters compose / gallery / outgoing-media read.
XVideoPlayerCreateResult
The tuple returned by XVideoPlayerBackend.create — everything the controller needs to start the load + route subsequent calls.
XVideoPlayerError
Terminal error. The controller marks the value as hasError = true and stops emitting state updates until XVideoPlayerBackend.disposeInstance.
XVideoPlayerEvent
Events pushed by the native side over ux/video/events. Sealed — new variants land here as the contract grows.
XVideoPlayerMetadata
Media metadata returned by XVideoPlayerBackend.initialize once the codec is ready.
XVideoPlayerSizeChanged
Fired when the codec reports a video-size change. Usually exactly once shortly after the first frame is decoded; some adaptive streams emit it on resolution changes (not in scope for the file-only constructor today but the event remains valid).
XVideoPlayerStateChanged
Periodic + edge-triggered state update. Any field may be null, meaning "no change since the last snapshot." Position is included on every emit; the rest are emitted on transition.
XVideoPlayerValue
Immutable snapshot of an XVideoPlayerController's state.
XVideoPlayerView
Renders the active frame of controller into the parent's box. Sizes itself to the parent — wrap in AspectRatio / FittedBox / Hero to control framing.
XVideoProbe
Dimensions, duration and a poster frame in one native round-trip.
XVideoProbeResult
What XVideoProbe.probe reports about one video file.

Functions

registerFfmpegLicense() → void
Registers the FFmpeg LGPL-2.1 attribution with LicenseRegistry.

Exceptions / Errors

XVideoExportException
Failure surfaced through XVideoExportSession.done.
XVideoPlayerException
Throws when a XVideoPlayerController call fails on the platform side. Maps from native PlatformException codes.