In-Game SHOUTcast Radio Player

A web-based SHOUTcast radio station directory and player that works in the Steam Community overlay, the in-game browser in Source engine games (the MOTD viewer), and any browser with support for Adobe Flash or Windows Media Player objects.

Important Note: If you just want to play some music on your own computer using the Steam Community overlay, you can use any website that plays music (Shoutcast.com, Pandora, etc.) in the game overlay's web browser. It is much more powerful than the browser in which Source displays the Message of the Day on servers.

Supports

While it works in any game on an individual user basis, game server admins can also create easy shortcuts for their players in the following games:

Features

Screenshot

In-Game Radio Screenshot

Demo

A fully functional web-based demo of each version, hosted here. Do not use these demos in your game server's web shortcuts or in your Steam profile (or link to them in any other fashion). These links will change on a regular basis. This isn't hard to host on your own server.

Flash version demo

Windows Media version demo

Requirements

Web Server

Game Server Mods (pick one)

Not required if you just want to use the radio on your computer via Steam.

Web Browser

Download

Instructions

For Individual Users

  1. Extract/upload the contents of the .zip file to your web server.
  2. By default, a directory called "radio" has been created. To run the radio, use the URL of that directory. For example, if you extracted the archive to the root of your web space, the URL will be like http://www.yoursite.com/radio .
  3. Add the URL as a link on your Steam profile.
  4. While in-game, hit Shift-Tab (the default combination) to bring up the Community overlay, click Community, click View my Profile, and click on the link you made to start the radio.

For Game Server Admins

  1. Extract/upload the contents of the .zip file to your web server.
  2. By default, a directory called "radio" has been created. To run the radio, use the URL of that directory. For example, if you extracted the archive to the root of your web space, the URL will be like http://www.yoursite.com/radio . Additionally, to allow your players to stop the stream in-game, there's a blank (black) HTML file at http://www.yoursite.com/radio/blank.html
  3. Configure two chat triggers for your game server using a method described above, one that points to the main /radio url (radio and/or !radio for example), and one that points to the /radio/blank.html file (stop and/or !stop and/or radiooff and/or !radiooff) for example.
  4. Give your users instructions on what the radio is and how to use it, either via your server's MOTD (message of the day), or via an announcements functionality in your admin plugin.

License and Code Info

You are authorized to do whatever you want with this code.

Note: I lost/deleted the Flash source file for the original Flash version of the player, but this blog describes the memory leak avoiding technique I used. It shouldn't be hard to make your own. If you look in the player.php file, you'll notice that the Flash MP3 Player can take a playTime parameter. This is the number of seconds a stream is played before a new instance of it is faded in and the old instance is faded out. This is 80 seconds by default. Setting this too high will cause people's games/browsers to crash; it depends on how much memory they have (or how much their browser has allotted to it).

Support

Email me. I can most likely help you out. Please attempt to use the instructions first, though.

Thanks

Rezz - Letting me know about Shoutcasts December 2010 change in their API URLs.