6

Here i'm developing radio , Radio link can be of aacp, aac or mpeg format . i'm using MultiPlayer jar to play aacp format and using Default MediaPlayer to play mpeg format , i know MultiPlayer can play both the format but i used different jar as per client requirement , is there any way to know streaming url is aacp , aac or mpeg from ShoutCast 7.html page ?

Thank You

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Ronak Mehta
  • 5,971
  • 5
  • 42
  • 69

1 Answers1

1

No, 7.html does not contain the stream content type.

<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>9,1,47,50,9,56,</body></html>

What you should do is make a request for the stream, and disconnect after the response headers are finished. (After you see \r\n\r\n from the server.) Pull the content type out of those headers. This will guarantee that you have the correct content type, and ensure that you are compatible with all sorts of HTTP and HTTP-like stream servers, including Icecast.

I don't know why you would want to do this, but the only other source available would be the admin page. You can access this without credentials, but you have the parse the HTML. Again, this would only be compatible with SHOUTcast servers. You should not do this.

<tr><td width=100 nowrap><font class=default>Content Type: </font></td><td><font class=default><b>audio/mpeg</b></td></tr>
Brad
  • 159,648
  • 54
  • 349
  • 530
  • Here my intention is to know client has uploaded link of aac,aacp,mpeg format. – Ronak Mehta Mar 25 '13 at 04:48
  • 1
    @Rstar, Yes, you need to connect to the stream to know that. Use a user-agent string that doesn't contain `Mozilla` to get the actual stream, or append a `;` to the URL. – Brad Mar 25 '13 at 13:13