How to play an audio from URL in flutter?
5,808
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.
Author by
Kiranpaul Issac
Updated on December 22, 2022Comments
-
Kiranpaul Issac over 1 year
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'); } }
-
Boby almost 4 yearsPlease share the error message...
-