-1

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"

Ravi Taak
  • 38
  • 5
  • Try with https://pub.dev/packages/pod_player pod_player package – Ravindra S. Patil Jun 14 '23 at 06:49
  • similar question answered here : https://stackoverflow.com/questions/67415863/flutter-ios-only-some-video-urls-are-playing-in-video-player-and-some-fail-to-i?rq=2 – Hardik Vaghani Jun 14 '23 at 07:14
  • Please share your code for better understanding. Also, please mention on which os you are facing the issue and also in which build mode you are running the app – Prashant Jun 14 '23 at 07:33

2 Answers2

0

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

Harsimran Singh
  • 269
  • 1
  • 7
-1

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

Baimam Boukar
  • 908
  • 5
  • 20