Reputation: 35
I need to add Youtube playlist with Youtube player in my flutter application.And i want to add multiple playlist. When i will upload video to youtube then autometically will have to appears on my flutter app.
I saw some tutorial, where people use hereku server to fetch youtube api to flutter app. But they use just a single playlist. here is the link
Can you tell me how i can add multiple playlist on my app. Thank You :)
Upvotes: 1
Views: 3016
Reputation: 435
I think you could maybe try a combination of this two packages:
youtube_api: With this package you could fetch all the videos inside a playlist and (as it goes directly through Youtube API) the list should update as soon as a new video is uploaded.
youtube_player_flutter: Given a certain list of youtube video ids, you can use this player to reproduce them (I’ve used it in a project and worked perfectly, even with live streams)
So, I guess that combining them would be my fist approach.
Update 31 Jan 20201
I tried youtube_api package but couldn't make it load the videos from a specific youtube playlistId neither, so I've checked their code and created a new implementation that only retrieves the videos from a specific playlistId.
Here is the code if you want to take a look https://github.com/rodrigoc85/flutter-load-youtube-playlist
Upvotes: 2