initializeVideoPlayerController method

Future<void> initializeVideoPlayerController()

Implementation

Future<void> initializeVideoPlayerController() async {
  try {
    await videoController.initialize();
    videoController.addListener(videoControllerListener);
    hasLoaded = true;
    if (widget.pickerConfig.shouldAutoPreviewVideo) {
      videoController.play();
    }
  } catch (e, s) {
    hasErrorWhenInitializing = true;
    realDebugPrint('Error when initializing video controller: $e');
    handleErrorWithHandler(e, onError, s: s);
  } finally {
    if (mounted) {
      setState(() {});
    }
  }
}