I have playlist youtube videos list and I get id and url how to play playlist youtube videos by id or url with youtube_player_flutter I tried but not worked.
Asked
Active
Viewed 1,094 times
3 Answers
0
you have to add youtube api to get metadata to your app. here is the link to get youtube API and get playlist : https://developers.google.com/youtube/v3/docs/playlists/list

Why_So_Ezz
- 160
- 1
- 7
0
If you are not gonna use Web
, then you can use youtube_player_iframe. you dont need api.
inside State
YoutubePlayerController _controller = YoutubePlayerController(
initialVideoId: '1oF3pI5umck',
params: YoutubePlayerParams(
// Defining custom playlist
startAt: Duration(seconds: 30),
showControls: true,
showFullscreenButton: true,
),
);
@override
void dispose() {
super.dispose();
_controller.close();
}
and use it like
YoutubePlayerIFrame(
// gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{},
controller: _controller,
aspectRatio: 16 / 9,
),
),
here is full code: SO youtube_player_iframe

Md. Yeasin Sheikh
- 54,221
- 7
- 29
- 56
0
I think you can use, better_player
for this. I have used it in Android and iOs and it works well but i don't know if it works on Web.
link: https://pub.dev/packages/better_player
for playlist documentation : https://jhomlala.github.io/betterplayer/#/playlistconfiguration

Ahmet KAYGISIZ
- 182
- 1
- 8