Wednesday, August 1, 2012

[android-developers] Error in MediaPlayer while streaming remote mp3 files

Hello, I'm having some problems streaming remote .mp3 files.
Inside my app I have a service that can play both local and remote files using :


mPlayer.setDataSource(local_path_or_remote_url);
mPlayer.prepareAsync();

 @Override
    public void onPrepared(MediaPlayer player) {

        player.start();

    }

This works fine for almost every file, but with some I recive the following error:

08-01 09:38:57.880: I/AwesomePlayer(127): setDataSource_l(http:/mydomain.com/public/files/5/Music/b178cdd6-359b-4801-9c43-c0320b1008e9.mp3')
08-01 09:38:57.880: V/ChromiumHTTPDataSource(127): connect on behalf of uid 10033
08-01 09:38:57.880: I/ChromiumHTTPDataSource(127): connect to http:/mydomain.com/public/files/5/Music/b178cdd6-359b-4801-9c43-c0320b1008e9.mp3 @0
08-01 09:38:58.646: I/NuCachedSource2(127): new range: offset= 345099
08-01 09:38:58.646: I/ChromiumHTTPDataSource(127): connect to http:/mydomain.com/public/files/5/Music/b178cdd6-359b-4801-9c43-c0320b1008e9.mp3 @345099
08-01 09:38:58.755: D/dalvikvm(395): GC_CONCURRENT freed 732K, 6% free 13750K/14599K, paused 3ms+7ms, total 40ms
08-01 09:39:00.599: I/ChromiumHTTPDataSourceSupport(127): We requested a content range, but server didn't support that. (responded with 200)
 
08-01 09:39:00.599: E/NuCachedSource2(127): source returned error -32, 10 retries left
 
08-01 09:39:03.599: I/ChromiumHTTPDataSource(127): Reconnecting...
08-01 09:39:03.599: I/ChromiumHTTPDataSource(127): connect to http:/mydomain.com/public/files/5/Music/b178cdd6-359b-4801-9c43-c0320b1008e9.mp3 @345099
08-01 09:39:03.857: I/ChromiumHTTPDataSourceSupport(127): We requested a content range, but server didn't support that. (responded with 200)
08-01 09:39:03.857: I/ChromiumHTTPDataSource(127): Reconnect failed w/ err 0xffffffe0
08-01 09:39:03.857: I/NuCachedSource2(127): The attempt to reconnect failed, 9 retries remaining
08-01 09:39:06.865: I/ChromiumHTTPDataSource(127): Reconnecting...
08-01 09:39:06.865: I/ChromiumHTTPDataSource(127): connect to http:/mydomain.com/public/files/5/Music/b178cdd6-359b-4801-9c43-c0320b1008e9.mp3 @345099
08-01 09:39:07.021: I/ChromiumHTTPDataSourceSupport(127): We requested a content range, but server didn't support that. (responded with 200)
08-01 09:39:07.021: I/ChromiumHTTPDataSource(127): Reconnect failed w/ err 0xffffffe0
08-01 09:39:07.021: I/NuCachedSource2(127): The attempt to reconnect failed, 8 retries remaining
08-01 09:39:10.021: I/ChromiumHTTPDataSource(127): Reconnecting...
08-01 09:39:10.021: I/ChromiumHTTPDataSource(127): connect to http:/mydomain.com/public/files/5/Music/b178cdd6-359b-4801-9c43-c0320b1008e9.mp3 @345099


ChromiumHttpDataSource keep retrying until MediaPlayer goes onError()

08-01 09:49:58.599: E/MediaPlayer(2484): Error (1,-2147483648)


If I download the file and launch it locally from my app, it plays without any problem.
I've tried my app on various ICS, Gingerbread and JellyBean devices,
the only one that was able to play all the remote files was the Huawei Sonic with Android 2.3.3.
Any ideas?

Thanks.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment