flutter playing a video from an asset

Viewed 357

when I'm trying to play a video saved in my assets I'm getting an error: this is the initialize of the asset code:

@override
  void initState() {
  _controller = VideoPlayerController.asset("videos/main_animation_one.mp4");
  _initializeVideoPlayerFuture = _controller.initialize();
  super.initState();
  }

this is my pubspec.yaml:

assets:
- assets/images/
- assets/videos/
- assets/sounds/

a picture of the error: enter image description here

playing a video from the network worked. thank you!

1 Answers
Related