Hi,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-US"><div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Can you please share a sample code which fetches the station list from the Icecast server and can play a station.</span></p>
</div></div></blockquote><br></div>I am attaching a very basic, bare-bone example in Python which:<br>- fetches the XML file<br>- converts it into a DOM object<br>- loops over it, extracting for each station it's server name, URL, bitrate and genre.<br>
<br>To play a URL, just feed it to the underlying player.<br><br>There are many other interesting things you can do from here on, like build a local cache, make a search by genre - and even avoid some caveats like broken UTF or HTML escaped characters in names and URLs etc. <br>
<br>For a full-featured example, you can check out this project: svn://<a href="http://svn.online.bg/plugin.audio.icecast/TRUNK">svn.online.bg/plugin.audio.icecast/TRUNK</a> - this is an Icecast plugin for XBMC media centre. It is Python and uses XBMC as a player. It stores the station list locally (either plain text file or SQLite) and auto-updates it at certain intervals; has a search; a favourites list; a recently listened list etc. It also deals with HTML escaped characters in names and URLs. More detaled description is here: <a href="http://bilbo.online.bg/~assen/icecast-addon/">http://bilbo.online.bg/~assen/icecast-addon/</a><br>
<br>Following the concept you can write the same virtually in any language (Python was chosen because I wanted to write an XBMC add-on and XBMC add-ons are only written in Python).<br><br>If you prefer Java, I have the same player made for Android, check out the code here: svn://<a href="http://svn.online.bg/android-icecast-player">svn.online.bg/android-icecast-player</a> (an Eclipse project) and see a description here: <a href="http://bilbo.online.bg/~assen/icecast-android">http://bilbo.online.bg/~assen/icecast-android</a> . It does not differ much, but uses Android's built-in player. It only uses SQLite (no plain-text storage). The biggest non-Icecast feature here is the circle menu, which was custom built for the project. <br>
<br>WWell,<br><br>Assen<br><br>