i am using audio_service
and i want to add to mediaItem in queue then i want to play song one by one
_setYtLInk() async {
for (var ytid in ytlinks) {
var ytExplode = yt.YoutubeExplode();
var video = await ytExplode.videos.streamsClient.getManifest(ytid);
var meta = await ytExplode.videos.get(ytid);
var audioStreamInfo = video.audioOnly.withHighestBitrate();
var item = MediaItem(
id: audioStreamInfo.url.toString(),
album: 'Unknown',
title: meta.title,
artist: 'Unknown',
duration: meta.duration,
artUri: Uri.parse('https://i.ytimg.com/vi/${ytid}/hqdefault.jpg'),
);
await _audioService.addQueueItem(item).then((_) {}).catchError((error) {
// check error
});
}
__audioService.play();
}
but its not playing please help me