Trying to use MediaPlayer to play an MP3 file hosted remotely on a
server that is serving the file up on a non-standard port (e.g. 8080).
Code looks like this:
android.net.Uri uri = android.net.Uri.parse("http://www.xyz.com:8080/
sample.mp3");
Log.d("debug", "port: " + uri.getPort()); // just verifying
Uri.parse() was ok. prints out port: 8080.
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(context, uri);
mp.prepareAsync();
However, I can see on the server that the request is made on port 80
regardless of the port set in the Uri. If the file gets server up on
port 80, then it plays fine.
Should I be setting the port elsewhere instead of in the Uri?
Thanks.
Rico Y
http://www.soundhound.com/android
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en