skip to Main Content

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


  1. So the problem is in Url in this URL
    you are using https

    "https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"

    but in this URL you are using http which causing error

    http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

    Error:

    Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$CleartextNotPermittedException: Cleartext HTTP traffic not permitted.
    

    Solution:

    Just replace the http to https

    Login or Signup to reply.
  2. 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 🎉

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