VideoEditorController.file constructor
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.
The file
argument must not be null.
Implementation
VideoEditorController.file(
this.file, {
this.maxDuration = Duration.zero,
this.minDuration = Duration.zero,
this.coverStyle = const CoverSelectionStyle(),
this.cropStyle = const CropGridStyle(),
TrimSliderStyle? trimStyle,
this.defaultCoverThumbnailQuality = 10,
}) : _video = kIsWeb
? VideoPlayerController.network(file.path)
: VideoPlayerController.file(
File(
// https://github.com/flutter/flutter/issues/40429#issuecomment-549746165
Platform.isIOS ? Uri.encodeFull(file.path) : file.path,
),
),
trimStyle = trimStyle ?? TrimSliderStyle(),
assert(maxDuration > minDuration,
'The maximum duration must be bigger than the minimum duration'),
assert(
defaultCoverThumbnailQuality > 0 &&
defaultCoverThumbnailQuality <= 100,
'defaultCoverThumbnailQuality should be between 0 and 100',
);