• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Live Stream Help

fsjr

Lurker
Nov 25, 2011
6
2
Hello all,

I made a MediaPlayer that plays a live stream, it worked perfectly, until I had to install on an Android 2.2 (Froyo) which did not work, he gets caught while invoking prepare and also prepareAsync, not error, but does not touch anything.

Poll Finds that this is a bug in version 2.2, which I understand was done until a correction in android.kernel.org, but I think it was not distributed to the phones through the carriers.

Well, I wonder if anyone has used or uses another method, such as Shoutcast satisfactorily and could give me a hint or even share the code so I can test it.

I tried to follow a tutorial Shoutcast and implement a variety of ways, but it is not so perfect, giving notice when the audio is exchanged.

Note: No emulator works, but not the device.

Thanks for any help that is sent.
[] 'S
Mitch
 
I didn't get the project.

Here is the class StreamProxy

So use something like...

Code:
...
int sdkVersion = 0;
try {
   sdkVersion = Integer.parseInt(Build.VERSION.SDK);
} 
catch (NumberFormatException ignored) { }
if (sdkVersion <= 8) {
if (proxy == null) {
   proxy = new StreamProxy();
   proxy.init();	 	       
   proxy.start();
}
url= String.format("http://127.0.0.1:%d/%s", proxy.getPort(), url);
}
mediaPlayer = new MediaPlayer();
mediaPlayerLive.setDataSource(url);
...
...
 
  • Like
Reactions: jamestisby
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones