1
I am developing an application that has in one of the functions play a streaming from a radio, the problem is that it worked on 1 Moto G2, 1 Moto G3 and on my ASUS Zenfone 2 LASER, it just doesn’t work is as if it doesn’t support the protocol.
all devices are on Android 6.0.1
String url = "http://104.247.207.42:8041/stream";
mp = new MediaPlayer();
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
try {
mp.setDataSource(url);
mp.prepare();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
Log.e(TAG, "SecurityException");
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
Log.e(TAG, "IllegalStateException");
} catch (IOException e) {
// TODO Auto-generated catch block
Log.e(TAG, "IOException");
}
Code that prepares the player on onCreate()
, he touches the onStart()
of service.
wanted to know why it does not play, does not return nor an error, and if I can use another lib without major difficulties to replace Mediaplayer’s Android.
Qual a versão do android nos aparelhos?
– Marco Giovanni
Could be a problem with Codec, already checked this?
– Guilherme Nascimento
the version is 6.0.1 at all, I am checking the codec and I will test with a lib that is very similar to the native android mediaplayer.
– Junior Nascimento
For those who had the same problem as mine, Here is the link lib that I used, it’s the same thing as Mediaplayer android, and it worked perfectly
– Junior Nascimento
You can answer your own question, if you have already solved it, it will help others in the future, and you can mark it as an accepted answer in 2 days @Juniornascimento
– Florida
All right, I’ll do it.
– Junior Nascimento