'how to play specific url audio from Audio List
i am new with using just_audio plugin and i have list of url that i set them into Player like following
AudioPlayer _audioPlayer;
_audioPlayer = AudioPlayer();
_audioPlayer
.setAudioSource(ConcatenatingAudioSource(children: [
AudioSource.uri(Uri.parse(
"https://archive.org/download/IGM-V7/IGM%20-%20Vol.%207/25%20Diablo%20-%20Tristram%20%28Blizzard%29.mp3")),
AudioSource.uri(Uri.parse(
"https://archive.org/download/igm-v8_202101/IGM%20-%20Vol.%208/15%20Pokemon%20Red%20-%20Cerulean%20City%20%28Game%20Freak%29.mp3")),
AudioSource.uri(Uri.parse(
"https://scummbar.com/mi2/MI1-CD/01%20-%20Opening%20Themes%20-%20Introduction.mp3")),
]))
Now How can i use _audioPlayer.play()with one specific url
in other word i need to tell him play the url that has index 3
how implement this , thanks
Solution 1:[1]
It seems that the purpose of ConcatenatingAudioSource is to play the children one after the other (or randomly with the shuffle options), as if it was one source. The doc doesn't seem to mention seeking to a specific index. I think you can achieve what you want just by re-setting the audio source every time, no ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MickaelHrndz |
