How to play mp3 audio from URL in Xmarine android in C# visual studio

soumenhaldersoumenhalder Member ✭✭

How to play mp3 audio from URL in Xmarine android in C# visual studio. Here I am able to play audio from the project but unable to play it via URL. I was trying the below mentioned code:

// playing audio from local storage
MediaPlayer _player;
_player = MediaPlayer.Create(this, Resource.Raw.HBD);
_player.Start();

// try to play audio from URL, but when execute then app crashed
MediaPlayer a = new MediaPlayer();
a.SetDataSource(this, Android.Net.Uri.Parse(MY_AUDIO_PATH_URL));
a.Prepare();
a.Start();

Best Answer

Answers

Sign In or Register to comment.