VideoEditorController class

Provides an easy way to change edition parameters to apply in the different widgets of the package and at the exportion This controller allows to : rotate, crop, trim, cover generation and exportation (video and cover)

Inheritance

Constructors

VideoEditorController.file(XFile file, {Duration maxDuration = Duration.zero, Duration minDuration = Duration.zero, CoverSelectionStyle coverStyle = const CoverSelectionStyle(), CropGridStyle cropStyle = const CropGridStyle(), TrimSliderStyle? trimStyle, int defaultCoverThumbnailQuality = 10})
Constructs a VideoEditorController that edits a video from a file.

Properties

cacheMaxCrop Offset
getter/setter pair
cacheMinCrop Offset
getter/setter pair
cacheRotation int
Get the rotation of the video, value should be a multiple of 90
no setter
coverStyle CoverSelectionStyle
Style for CoverSelection
final
croppedArea Size
Get the Size of the videoDimension cropped by the points minCrop & maxCrop
no setter
cropStyle CropGridStyle
Style for CropGridViewer
final
defaultCoverThumbnailQuality int
Quality of default thumbnail
final
endTrim Duration
The endTrim param is the maximum position of the trimmed area in video position in Duration value
no setter
file → XFile
Video from XFile.
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
initialized bool
Get the VideoPlayerController.value.initialized
no setter
isCropping bool
getter/setter pair
isPlaying bool
Get the VideoPlayerController.value.isPlaying
no setter
isRotated bool
no setter
isTrimmed bool
Get the isTrimmed
no setter
isTrimming bool
Get the isTrimming
getter/setter pair
maxCrop Offset
The maxCrop param is the Rect.bottomRight position of the crop area
no setter
maxDuration Duration
Get the maxDuration param
getter/setter pair
maxTrim double
The maxTrim param is the maximum position of the trimmed area on the slider
no setter
minCrop Offset
The minCrop param is the Rect.topLeft position of the crop area
no setter
minDuration Duration
Get the minDuration param
getter/setter pair
minTrim double
The minTrim param is the minimum position of the trimmed area on the slider
no setter
preferredCropAspectRatio double?
The preferredCropAspectRatio param is the selected aspect ratio (9:16, 3:4, 1:1, ...)
getter/setter pair
rotation int
Get the rotation of the video, possible values are: 0, 90, 180 and 270
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedCoverNotifier ValueNotifier<CoverData?>
Get the selectedCover notifier
no setter
selectedCoverVal CoverData?
Get the selectedCover value
no setter
startTrim Duration
The startTrim param is the maximum position of the trimmed area in video position in Duration value
no setter
trimmedDuration Duration
The Duration of the selected trimmed area, it is the difference of endTrim and startTrim
no setter
trimPosition double
Get the trimPosition, which is the videoPosition in the trim slider
no setter
trimStyle TrimSliderStyle
Style for TrimSlider
final
video → VideoPlayerController
Get the VideoPlayerController
no setter
videoDimension Size
Get the VideoPlayerController.value.size
no setter
videoDuration Duration
Get the VideoPlayerController.value.duration
no setter
videoHeight double
no setter
videoPosition Duration
Get the VideoPlayerController.value.position
no setter
videoWidth double
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
applyCacheCrop() → void
Update the minCrop and maxCrop with cacheMinCrop and cacheMaxCrop
createCoverFFmpegConfig() CoverFFmpegConfig
createVideoFFmpegConfig() VideoFFmpegConfig
cropAspectRatio(double? value) → void
Update the preferredCropAspectRatio param and init/reset crop parameters minCrop & maxCrop to match the desired ratio The crop area will be at the center of the layout
dispose() Future<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
generateDefaultCoverThumbnail() → void
Generate cover at startTrim time in milliseconds
initialize({double? aspectRatio}) Future<void>
Attempts to open the given video File and load metadata about the video.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
rotate90Degrees([RotateDirection direction = RotateDirection.right]) → void
Rotate the video by 90 degrees in the direction provided
setPreferredRatioFromCrop() → void
Set preferredCropAspectRatio to the current cropped area ratio
toString() String
A string representation of this object.
inherited
updateCrop(Offset min, Offset max) → void
The min param is the Rect.topLeft position of the crop area The max param is the Rect.bottomRight position of the crop area
updateSelectedCover(CoverData selectedCover) → void
Replace selected cover by selectedCover
updateTrim(double min, double max) → void
Update minTrim and maxTrim.

Operators

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