VideoController class

The controller of VideoView. Add VideoPlayerController.

initialize, play, setLooping, pause, seekTo, setVolume

Inheritance

Constructors

VideoController({required VideoPlayerController videoPlayerController, VideoConfig? videoConfig})
Constructs a VideoController playing a video from an asset.

Properties

config VideoConfig
Config.
no setter
fullScreenStream StreamController<bool>?
Monitor fullscreen status changes.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hideSeconds int
Time to hide the controller.
no setter
isFirstInit bool
Whether to initialize for the first time. If the initialization process fails for the first time, it will enter the infinite retry stage after re initialization.
getter/setter pair
maxPlaybackSpeed double
Maximum playback speed.
no setter
maxPreviewTime Duration?
Maximum preview duration.
no setter
playSpeeds List<double>
Playback speeds.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value VideoValue
The current value stored in this notifier.
getter/setter pairinherited
videoPlayerController VideoPlayerController
The controller of video.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
enterFullScreen() → void
Enter full-screen mode.
exitFullScreen() → void
Exit full-screen mode.
initialize() Future<void>
Initialize the controller.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
pause() Future<void>
Pauses the video.
play() Future<void>
Starts playing the video.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
Reset properties, including isMaxPlaybackSpeed, isVerticalDrag, verticalDragValue, isDragProgress, dragDuration, etc.
resetSeconds() → void
Reset seconds.
seekTo(Duration? moment) Future<void>
Sets the video's current timestamp to be at moment.
setDragDuration(Duration duration) → void
Sets the duration of the slide.
setDragProgress(bool isDragProgress) → void
Set whether the progress can be adjusted.
setFullScreen(bool isFullScreen, {bool isFire = true}) → void
Set whether the screen is full.
setLock(bool isLock) → void
Sets whether the controller is locked.
setLooping(bool looping) Future<void>
Sets whether or not the video should loop after playing once.
setMaxPlaybackSpeed(bool isMaxPlaybackSpeed) → void
Set whether to turn on the maximum speed playback.
setPlaybackSpeed({double? speed}) Future<void>
Sets the playback speed of video.
setVerticalDrag(bool isVerticalDrag) → void
Set whether to display the adjustment progress of brightness or volume.
setVerticalDragType(VerticalDragType? verticalDragType) → void
Sets the type of adjustment.
setVerticalDragValue(double verticalDragValue) → void
Sets the current value (brightness or volume).
setVisible(bool isVisible) → void
Set the explicit and implicit of the controller.
setVolume(double volume) Future<void>
Sets the audio volume of video.
showOrHide({bool? visible, bool startTimer = true}) → void
Change the state of the controller so that it can be shown or hidden.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

of(BuildContext context) VideoController