media-kit / media-kit

A cross-platform video player & audio player for Flutter & Dart.
https://github.com/media-kit/media-kit
MIT License
893 stars 126 forks source link

Single player multiple video on web? #759

Closed jemisgoti closed 1 month ago

jemisgoti commented 1 month ago

I have an app in which I display a video in the carousel. Every third child is the same video. So Is it possible to display multiple videos using the same player on the web? I tested it on the desktop and it's working.

alexmercerind commented 1 month ago

The web implementation suffers with a limitation:

https://github.com/media-kit/media-kit/blob/77a130b1d7ce733b47d2133b57563716090450d0/media_kit_video/lib/src/video_controller/video_controller.dart#L44-L54

The second point. We can't really do anything in this regard, web browsers are made this way. However, I really think you can add in some additional conditions/checks to prevent same video widget from being mounted simultaneously.

jemisgoti commented 1 month ago

@alexmercerind Thanks for the quick response. I will try to find a solution using multiple controllers.