Question

Hi I have made an app with a list of four radio station streaming. I am using simple mediaPlayer which is initialized in a service.The code I have used like this:

try {
    MediaPlayer media = new MediaPlayer();
    media.setAudioStreamType(AudioManager.USE_DEFAULT_STREAM_TYPE);
    media.setDataSource(URL);
    media.prepareAsync();
    media.start();
} catch(Exception e) {
  //Getting Exception
}

The four radio links are : http://s2.voscast.com:7016/ , http://s8.voscast.com:7024/ , http://s8.voscast.com:7020/ , http://s5.voscast.com:8216/.

Now the problem is that in the first link it takes 30-45 sec to start playing radio and in all other it takes less than or around 10 seconds. What could be the possible problem is that something related to the code or something from the URL itself? What could be the solution for this? Please Help?

Was it helpful?

Solution

Your code is fine. It's likely that your host is having trouble, or the servers are far away from you across the internet. (This is problematic for streaming over HTTP, as packet loss can be quite high over some distance connections, which kills your throughput rate.)

OTHER TIPS

this is related to URL, may be broadcasting server is down and u are getting late response.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top