views:

568

answers:

3

Hi

I cant find a way to use an url that requires basic auth when im useing mp.setDataSource(url);

MediaPlayer mp = new MediaPlayer();    
mp.setDataSource(url);
mp.prepareAsync();

Anyone that got any ideas?

+1  A: 

Have you tried putting the user ID and password in the URL?

http://<user>:<password>@<host>:<port>/<url-path>
CommonsWare
Yes, but it didnt work. Thanks
PHP_Jedi
A: 

I don't think the native media player supports this.

PHP_Jedi
A: 

You could download the mp3 on the cache and play it, here is a post on that http://almondmendoza.com/2010/03/11/play-mediaplayer-with-authentication-on-android/

monmonja