1

I created an app for android (only versions 2.2+) that makes use of the MediaPlayer to stream audio from the internet. It works flawlessly on the emulator. However, when running it on my device (Droid X), it won't play the music. Any ideas of what could be wrong?

Here's the gist of the code. Note: this code runs in a service.

MediaPlayer mp = new MediaPlayer();
mp.setOnPreparedListener(this)
mp.setDataSource(PATH_TO_STREAM);
mp.prepareAsync();

The in onPrepared:

mp.start();
Jake
  • 11
  • 2
  • Without any code sample at all, how are we supposed to tell you what you're doing wrong?!? – EboMike Nov 01 '10 at 21:40
  • Well I felt that was pointless, after all it runs Perfectly on the emulator. Why would something run on the emulator and then fail on the deivce?? – Jake Nov 01 '10 at 21:41
  • Lots of reasons, but without some code it's often hard to help. – dhaag23 Nov 01 '10 at 21:44
  • Sounds like my issue http://stackoverflow.com/questions/3937610/basic-streaming-audio-works-in-2-1-but-not-in-2-2 Simple audio streaming code doesn't work on 2.2 devices, only in emulator. No solution found yet. – ShadowGod Nov 02 '10 at 00:59

2 Answers2

1

Jake, we have the same problem. It has to be Motorola's port of 2.2

I have to suspect that most developers used the Proxy code from the NPR site to make it work. That's a good bit of overhead to get around a port on a particular device IMHO.

John Stack
  • 618
  • 1
  • 4
  • 19
  • yep - I asked about this on the MOTODEV forums and an official tech responded informing me that an old version of the underlying player is being used. Seems to also be present in other Verizon devices. The problem player in Motorola's 2.2 is PVPlayer/PlayerDriver. Ugh. The correct player is AwesomePlayer/StageFright, which is in 2.2 for *most* devices. – brack Jun 10 '11 at 18:44
0

I do have the same exact problem with you. I am not sure either why this happened on Samsung Galaxy GIO. How Can we solve this issue ?

I snip some line on my source and logcat that I hope might be useful for further debugging: https://picasaweb.google.com/yeo.eugene.oey/Android?authkey=Gv1sRgCMnlqL689NuFuQE#

Update:

I tried on my friends HTC HD 2 Gingerbread, It runs. Perhaps you could try on other device or Android 2.3 too :)

Yeo
  • 11,416
  • 6
  • 63
  • 90