skip to Main Content

hey guys i wrote codes in flutter for playing videos and an image in the screen for download ,but videos can not play .could you help me to find why? i wrot a stateful widget for this screen and the codes about videos :
void initState() {your text, super.initState(); // Initialize video controllers
videoController1 = VideoPlayerController.asset(‘backgrounds/eyes-1.mp4..initialize().then(() {‘setState(() {}); }); videoController2 = VideoPlayerController.asset(‘backgrounds/eyes-2.mp4’)
..initialize().then((
) setState(() {}); }); }
i change format of videos to webM but it was work.

2

Answers


  1. Chosen as BEST ANSWER

    When i wrote codes here with the correct format , it does not alow to me to save my question , i dont know where is my fault .but please answer to me , i use video_player package in my code and video's format is mp4 , i use videoplayercotroller.asset to set my video path , but in emulator the videos can not play .please guide me


  2. @Negar Tavakol Please attach full code with good format so we can provide you additional solution and please check one thing make sure you are actually using videoplayer widget to display video in your UI .

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search