Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Video player for web, mobile and desktop applications in Flutter?

There is this Flutter plugin for playing videos on iOS & Android (Video Plugin)

However, I also want to embed a video player into my web and desktop applications.

So I dont understand how Flutter is going this way of supporting plugins for different platforms. Because if you have a look at the video plugin it makes use of the AVPlayer on iOS and ExoPlayer on Android, but these are not then supported for web and desktop applications.

My Questions: Why isn't the community writing a Flutter plugin for videos which is independent of it's underlying platform? Or isn't it possible? Why do we have to rely so much on Android & iOS especially if Flutter will be more and more platform independent in the future? Isn't it possible to write the source code for making videos working on different platforms solely with the Dart language & Flutter framework?

Is there currently a way to embed a video player for web and desktop applications?

like image 706
GreenTigerEye Avatar asked May 19 '19 09:05

GreenTigerEye


People also ask

Is flutter good for desktop application?

Plus, as of February 2022, Flutter is now stable for Windows! This means that you can start creating production apps using Flutter. If you already have a Flutter app that runs on Android or iOS, and you were considering bringing that app to Windows, now would be a great time to do so.

How do you play video from assets in flutter?

How to Play Video from Assets Folder? To play video from the assets folder, create a folder at your project root, and place your video in that folder. For example, we have created assets/videos/ folders at the root of our project.

Is flutter single codebase for web and mobile?

Flutter - created by Google, open to everyoneIt is used for building natively compiled mobile and web applications with one codebase. That means that you can basically create two different apps for iOS and Android using only one programming language and single codebase.


1 Answers

You can use dart_vlc to add video playback to your Flutter desktop application.

It currently supports Windows & Linux, we are working on adding macOS support actively.

The library is rather easier to use aswell,

Player player = Player(id: 0);
player.open(
  Playlist(
    medias: [
      Media.file(File('C:/music.mp3')),
      Media.file(File('C:/audio.mp3')),
      Media.network('https://www.example.com/music.aac'),
    ],
  ),
);

Thanks. Checkout project README for more examples and documentation.

like image 89
Hitesh Kumar Saini Avatar answered Nov 01 '22 22:11

Hitesh Kumar Saini