I have a video link and I want to play video in flutter how can I play?
I try using videoplayer plugin but its not work with this url –
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
but I can play with this url why?
"https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"
2
Answers
So the problem is in Url in this URL
you are using https
but in this URL you are using http which causing error
Error:
Solution:
Just replace the http to https
The issue you’re coming accross is likely due to the specific video URL you’re using.
In fact, videos URLs may have different formats or codecs, which can impact their compatibility with different flutter video players or plugins.
The second video is more likely to be encoded using a format or codec that is compatible with the video player plugin you’re using, hence why it works.
So next steps will be investigating and see if the plugin you’re using supports the format or codec of the particular video that you want to play
You can find a list of most popular flutter video plugins here by the way
Also, the problem might be coming from the fact that the first video is hosted on a http domain name, not https. Try another http video and see how it goes.
Happy coding 🎉