Skip to content Skip to sidebar Skip to footer

Do All Versions Of Android Support The Mediaplayer Streaming?

As the title says, I'm basically wondering if the MediaPlayer streaming support works for all versions of Android. Here is the code I'm currently using, which works fine on my Andr

Solution 1:

According to Android References the MediaPlayer class has been available since api level: 1 and there isn't anything about it being deprecated. So I would say you would be safe.

On your 1.6 emulator have you started the browser and made sure you can access the internet?

Was the 1.6 emulator one that you have create some time ago? I have had issues with emulators that I have created after a period of time (the files get corrupted). If that is the case you could create a new one.

Another thing I just thought of... Is there some authentication missing somewhere?

I found this tutorial that might be helpful as well. He does create a buffer in his example.

Solution 2:

I think the problem is with the setDataSource. its not reading the file properly. The better way is read by FileInputStream and call getFD() method.Ex:

MediaPlayer mPlayer = new MediaPlayer();

FileInputStream stream = mContext.openFileInput("string");

mPlayer.setDataSource(stream.getFD());

stream.close();

mPlayer.setAudioStreamType(ANNOUCE_STREAM);

mAndroidPlayer.prepare();

mAndroidPlayer.start();

I think this will help you.

Post a Comment for "Do All Versions Of Android Support The Mediaplayer Streaming?"