VideoEditorController.file constructor

VideoEditorController.file(
  1. XFile file, {
  2. Duration maxDuration = Duration.zero,
  3. Duration minDuration = Duration.zero,
  4. CoverSelectionStyle coverStyle = const CoverSelectionStyle(),
  5. CropGridStyle cropStyle = const CropGridStyle(),
  6. TrimSliderStyle? trimStyle,
  7. 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',
      );