I am trying to create a web app using recently launched flutter_web, but facing issues in playing a video inside my app. Can someone guide me how to play a video in flutter_web.
prefix1.VideoElement element = prefix1.VideoElement();
element.height = 200;
element.width = 200;
element.appendHtml("""<video width="400" controls>
<source src="mov_bbb.mp4" type="video/mp4">
<source src="mov_bbb.ogg" type="video/ogg">
Your browser does not support HTML5 video.
</video>
""");
element.querySelector('#video');
element.play();
You can now just use the official video_player_web plugin by adding it to your pubspec.yaml
:
video_player: ^0.10.4+1
video_player_web: ^0.1.0
Then you can follow the video player cookbook or use the chewie plugin to get a nice UI.