Create a "Now Playing" List on Your Website with Winamp and Java Servlets
- The Winamp Now Playing Plug-in
- Installation and Configuration of the Now Playing Plug-in
- Using a Java Servlet Container Approach
- The NowPlayingServlet
In a previous InformIT article, I showed you how to broadcast audio using SHOUTcast in tandem with Winamp. Once you have your Winamp-powered Internet radio station up and running, you'll likely want to be able to publicize your audio offering on the Internet. Here you'll learn how to let your website visitors know what song you are currently playing on your broadcast using a free Winamp plug-in.
The Winamp Now Playing Plug-in
To keep website visitors informed on what you are broadcasting via your Winamp-based broadcast, you can use the Now Playing Plug-in, developed by Antti Nevala and Lauri Nevala. At the time of this writing, the plug-in is in version 1.4.1; you can download it at http://www.cc.jyu.fi/~ltnevala/nowplaying/index.php or at Winamp's site. The Now Playing Plug-in is compatible with Winamp5 and Winamp2.
The Now Playing Plug-in provides information about the currently playing track and recently played tracks in Winamp. The track information is extracted from the ID3 tag of the MP3 files you are playing. (You can learn more about ID3 tags at http://www.id3.org/id3v1.html.)
The Now-Playing Plug-in lets you send information about your currently playing track and track playing history in a number of ways:
- Via HTTP Post—The plug-in can send an HTTP Post to a web server.
- Via FTP—The plug-in can produce an HTML file based on settings you provide and then can FTP the file to an FTP server.
- Via a local save—The plug-in can produce an HTML file based on settings you provide and then can save it locally.
Here we'll focus our attention on the plug-in's ability to place an HTTP Post request to a web server. The HTTP Post that the Now Playing Plug-in performs contains information about the currently playing track and recently played tracks in its payload. The following information, in particular, is contained in the payload of the HTTP Post for the currently playing or last played track:
- Year (of release)
- Length (of track)