marvin ralph
marvin ralph

Reputation: 1280

Displaying Multiple Videos In Flutter

I'm trying to display a list of videos on my UI just like the way the Youtube app is. But my issue is i just cant find how to display the list of videos using the VideoPlayer plugin. The video player plugin takes just a VideoPlayerController and i don't know how to set all the list of videos to the controller so when they user tap on any video it plays. Or would i have to create lots of VideoPlayerController in a loop and assign them to each video in the list?

Upvotes: 3

Views: 3620

Answers (2)

ZeroDev
ZeroDev

Reputation: 11

just create new variable call path

String? _path;

then

_controller = VideoPlayerController.asset(_path!);

now, you can passing the path variable from resource that you have

Upvotes: 1

Jitesh Mohite
Jitesh Mohite

Reputation: 34170

Add Dependency

chewie: ^0.9.10

Overall, for showing youtube like list, you need separate thumbnail images, so that on clicked specific video can be played.

Run below code, where everything is available which you required.

https://github.com/codemissions/flutter-video-streaming-app

Upvotes: 1

Related Questions