I have tried the following code but it didn't work.
AudioPlayer _audioPlayer = AudioPlayer();
play() async {
int result = await _audioPlayer.play('http://thedemos.in/mind/uploads/audio/WjYYX_Namaste2.mp3');
if (result == 1) {
setState(() {
isPlaying = true;
});
print('Success');
}
}
assets_audio_player 2.0.7+9 use this music player, Where you can play music from the network as well as from assets folder. And Also you don't need to handle it in the background.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With