Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Content Type from ShoutCast 7.html

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

like image 686
Ronak Mehta Avatar asked Mar 23 '13 06:03

Ronak Mehta


1 Answers

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>
like image 63
Brad Avatar answered Nov 01 '22 11:11

Brad