exportVideo method

dynamic exportVideo()

Implementation

exportVideo() {
  if (trimmer.videoPlayerController.value.isPlaying){
    trimmer.videoPlayerController.pause();
  }
  setState(() => _exported = true);
  Future.delayed(Duration(seconds: 1)).then((value){
    trimmer.saveTrimmedVideo(
        startValue: _startValue,
        endValue: _endValue,
        // storageDir: StorageDir.temporaryDirectory,
        onSave: (s) async{
          File file = File(s);
          // File fileMov = File(ss);
          _exported = false;
          // setState(() {
          if (widget.isMultipel != null && !widget.isMultipel!){
            Navigator.pop(context);
          }else{
            // popBack();


            // if (Platform.isAndroid){
            //   await VideoCompress.setLogLevel(0);
            //   final info = await VideoCompress.compressVideo(
            //     file.path,
            //     quality: VideoQuality.MediumQuality,
            //     deleteOrigin: false,
            //     includeAudio: true,
            //   );
            //   if (info != null && info.file != null){
            //     file = info.file!;
            //   }
            // }

            // replace try
            SellonRouter.replace(context, VideoPreviewFile(
              videoFileMov: file,
              key: widget.key,
              videoFile: file,
              isFromCamera: widget.isFromCamera!,
            ));


            // last one
            // SellonRouter.push(
            //     context,
            //     VideoPreviewFile(
            //       videoFileMov: file,
            //       key: widget.key,
            //       videoFile: file,
            //       isFromCamera: widget.isFromCamera!,
            //     )).then((va){
            //   _exported = false;
            //   setState(() {
            //
            //   });
            //   trimmer.videoPlayerController.play();
            // });
          }
          // });
          // trimmer.saveTrimmedVideo(
          //   // storageDir: StorageDir.temporaryDirectory,
          //     startValue: _startValue, endValue: _endValue, onSave: (ss) async {
          //
          // },outputFormat: FileFormat.mov);
        },
        outputFormat: FileFormat.mp4);
  });

}