Displaying Multiple Videos In Flutter

Viewed 2594

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?

2 Answers

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

Related