loadVideo method

Future<void> loadVideo({
  1. required File videoFile,
  2. VideoPlayerOptions? videoPlayerOptions,
})

Loads a video using the path provided.

Returns the loaded video file.

Implementation

Future<void> loadVideo(
    {required File videoFile, VideoPlayerOptions? videoPlayerOptions}) async {
  currentVideoFile = videoFile;
  if (videoFile.existsSync()) {
    _videoPlayerController = VideoPlayerController.file(
      currentVideoFile!,
      videoPlayerOptions: videoPlayerOptions,
    );

    await _videoPlayerController!.initialize().then((_) {
      _controller.add(TrimmerEvent.initialized);
    });
  }
}