Shoutcast Radio on Android -


I'm making an app to stream radio content from the Internet! And I spent so much time trying to show a simple source code how to implement a streaming content! I found some useful links in stack overflow but nobody works for me !! I need your help ! Here's the piece of code I made but still does not work! And I do not know why! Ps: The URL of the radio station is working fine

  package com.example.radio; Import android App Import android Media. Audio manager; Import android Media. media Player; Import android.media.MediaPlayer.OnPreparedListener; Importroid.os.Bundle; Import android.util.log; Implementation of public class main activity activity increases OnPreparedListener {MediaPlayer mp; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.activity_main); Try {mp = new mediaplayer (); String url = "http://108.168.175.174:7120"; Mp.setAudioStreamType (AudioManager.STREAM_MUSIC); Mp.setDataSource (url); Mp.prepareAsync (); Mp.setOnPreparedListener (this); } Hold (exception e) {Log.i ("ExceptionOnCreate:", e.getMessage ()); }} @ Override Public Watch on Pepere (Mediaplayer MP) {mp.start (); }}  

Here the log cat is:

  05-06 10: 20: 07.291: e / mediaplayer (1470): error (1, - 2147483648 ) 05-06 10: 20: 07.291: E / Media Player (1470): Error (1, -2147483648)  

SHOUTcast is likely to cause you problems due to sending you to the administrator interface. If your user agent is Mozilla in the string, you get the admin page in place of the stream. You can override this behavior by requesting a semicolon in your URL:

  http://108.168.175.174:7120/;  

This will force your user agent to see the string as mpeg override , and it will send you the actual stream.

If that does not fix it, then you are potentially raising an issue where SHOUTcast servers are not conforming to HTTP, they are ICY 200 OK instead of HTTP / 1.0 200 OK as its status line, which breaks many clients.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -