MethodChannelXVideoPlayerBackend class
Production XVideoPlayerBackend. Hand-rolled MethodChannel +
EventChannel — matches the rest of package:ux, no pigeon.
- Implemented types
Constructors
- MethodChannelXVideoPlayerBackend()
-
Creates a backend bound to the
ux/videochannels.
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.override -
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.
override
-
events(
int handle) → Stream< XVideoPlayerEvent> -
Live event stream for
handle. The controller subscribes during create / initialize and unsubscribes on disposeInstance.override -
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.
override
-
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.
override
-
play(
int handle) → Future< void> -
Start or resume playback.
override
-
seekTo(
int handle, Duration position) → Future< void> -
Move the playhead to
position.override -
setLooping(
int handle, bool loop) → Future< void> -
Set whether the track restarts on reaching its end.
override
-
setPlaybackSpeed(
int handle, double rate) → Future< void> -
Set playback rate, where 1 is real time.
override
-
setVolume(
int handle, double volume) → Future< void> -
Set playback gain, from 0 to 1.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited