Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

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

$
0
0

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();

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>