XVideoPlayerBackend class abstract
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).
Every per-instance call carries a handle returned by create so
the plugin can route to the right native session. Multiple
controllers can hold simultaneous handles.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
create(
{required String uri}) → Future< XVideoPlayerCreateResult> -
Allocate a native player instance bound to
uri(file://...for local playback, or an http(s) URL for network streaming). Returns the handle and the Flutter texture id the player renders into. -
disposeInstance(
int handle) → Future< void> - Tear down the session. Releases the codec and any held surface / texture. Safe to call repeatedly; no-op once disposed.
-
events(
int handle) → Stream< XVideoPlayerEvent> -
Live event stream for
handle. The controller subscribes during create / initialize and unsubscribes on disposeInstance. -
initialize(
int handle) → Future< XVideoPlayerMetadata> - Load the media. Resolves once the codec is configured and metadata (size, duration) is known. Throws XVideoPlayerException("decode_failed") if the file can't be opened or the codec init failed permanently.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
int handle) → Future< void> - Halt playback, leaving the playhead where it is.
-
play(
int handle) → Future< void> - Start or resume playback.
-
seekTo(
int handle, Duration position) → Future< void> -
Move the playhead to
position. -
setLooping(
int handle, bool loop) → Future< void> - Set whether the track restarts on reaching its end.
-
setPlaybackSpeed(
int handle, double rate) → Future< void> - Set playback rate, where 1 is real time.
-
setVolume(
int handle, double volume) → Future< void> - Set playback gain, from 0 to 1.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ XVideoPlayerBackend
-
Swap to inject a fake before any UI code mounts a controller.
getter/setter pair