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
-
- Object
- ChangeNotifier
- VideoEditorController
Constructors
- VideoEditorController.file(File file, {Duration? maxDuration, TrimSliderStyle? trimStyle, CoverSelectionStyle? coverStyle, CropGridStyle? cropStyle})
- Constructs a VideoEditorController that edits a video from a file.
Properties
- cacheMaxCrop ↔ Offset
-
getter/setter pair
- cacheMinCrop ↔ Offset
-
getter/setter pair
- coverStyle → CoverSelectionStyle
-
Style for CoverSelection
final
- cropStyle → CropGridStyle
-
Style for CropGridViewer
final
- endTrim → Duration
-
The endTrim param is the maximum position of the trimmed area in video position in Duration value
no setter
- file → File
-
Video from File.
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 - isTrimming ↔ bool
-
Get the isTrimming
getter/setter pair
- isTrimmmed → bool
-
Get the
isTrimmed
no setter - maxCrop ↔ Offset
-
The maxCrop param is the Rect.bottomRight position of the crop area
getter/setter pair
- maxDuration → Duration
-
Get the maxDuration param
no setter
- maxTrim ↔ double
-
The maxTrim param is the maximum position of the trimmed area on the slider
getter/setter pair
- minCrop ↔ Offset
-
The minCrop param is the Rect.topLeft position of the crop area
getter/setter pair
- minTrim ↔ double
-
The minTrim param is the minimum position of the trimmed area on the slider
getter/setter pair
- 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
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedCoverNotifier
→ ValueNotifier<
CoverData?> -
Get the
selectedCover
notifierno setter - selectedCoverVal → CoverData?
-
Get the
selectedCover
valueno setter - startTrim → Duration
-
The startTrim param is the maximum position of the trimmed area in video position in Duration value
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 Size of the video
no setter
- videoDuration → Duration
-
Get the
VideoPlayerController.value.duration
no setter - videoPosition → Duration
-
Get the
VideoPlayerController.value.position
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
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
-
exportVideo(
{required void onCompleted(File file), void onError(Object, StackTrace)?, String? name, String? outDir, String format = "mp4", double scale = 1.0, String? customInstruction, void onProgress(Statistics, double)?, VideoExportPreset preset = VideoExportPreset.none, bool isFiltersEnabled = true}) → Future< void> -
Export the video using this edition parameters and return a
File
. -
extractCover(
{required void onCompleted(File file), void onError(Object, StackTrace)?, String? name, String? outDir, String format = "jpg", double scale = 1.0, int quality = 100, void onProgress(Statistics)?, bool isFiltersEnabled = true}) → Future< void> - Export this selected cover, or by default the first one, return an image File.
-
generateCoverThumbnail(
{int timeMs = 0, int quality = 10}) → Future< CoverData> -
Generate a cover at
timeMs
in video -
generateDefaultCoverThumbnail(
) → void - Generate cover at startTrim time in milliseconds
-
getMetaData(
{required void onCompleted(Map? metadata)}) → Future< void> - Return the metadata of the video file using Ffprobe
-
initialize(
{double? aspectRatio}) → Future< void> -
Attempts to open the given video File and load metadata about the video.
Update the trim position depending on the maxDuration param
Generate the default cover
_selectedCover
Initialize minCrop & maxCrop values based onaspectRatio
-
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 -
toString(
) → String -
A string representation of this object.
inherited
-
updateCrop(
) → void - Update the minCrop and maxCrop with cacheMinCrop and cacheMaxCrop
-
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