Flash 8 required

Minicaster Flash Music Playhead::Support

Patching Icecast2.3.1 for Flash playback of MP3 streams in IE7

Minicaster and Minicaster pro-ICE both work extremely reliably on Firefox and Safari, but Internet Explorer 7 has decided not to play ball - this means that many Flash playheads (not just ours) have found they cannot connect to Icecast2 servers, or rather they can connect and seem to be downloading something but they just hear silence.

The problem is a content-length limit, and the solution is a patch!

When Icecast2 sends a stream it of course has no idea how 'big' it is, as it can play forever. The Icecast developers made up a random number for the content-length header variable, and for most browsers that's fine.. they get confused trying to show the 'percent downloaded' but we don't care about that as long as the file is delivered to Flash. IE7 however has a 'feature' which simply eats anything that reports a content-length greater than a certain figure. It still tries to download it, but it passes garbage to Flash. The result is that in Flash we see audio data, and it has a duration like we'd expect, but the critical download progress information is never sent. Flash refuses to begin playback until it has a certain quantity of audio in the buffer, and since IE7 refuses to talk to it, Flash sits there and does nothing. All this time the data is still downloading and the Icecast server owner is seeing 'a listener' - and often paying for them!

This issue is due to be fixed in the next trunk release of Icecast2, but for those still using an older version you need to either edit the Icecast2 code and recompile it, or switch to one of the 'development branch' versions of Icecast.

Using a development branch

The latest KH branch builds of Icecast support the correct content length, and both Unix tarballs and a Win32 installer can be downloaded from http://www.icecast.pwp.blueyonder.co.uk. Please note that while the KH branch is relatively stable, it is not always as reliable as the trunk version. It does however give Win32 users access to the updated code without needing to buy a compiler.

Patching the source code

Under Linux-Unix it's a 30-second job, but under Windows you may find it more fun - and need 3rd-party compilers to do it. However for the majority of linux servers people actually prefer to rebuild from source. All you need to do is change one line in one file:-

The patch (based on an icecast 2.3.1 source package)

The change is to the file 'src/format_mp3.c' - search for the line containing "x-flash-version" and you'll find this:-
if (httpp_getvar(client->parser, "x-flash-version")) { bytes = snprintf (ptr, remaining, "Content-Length: 347122319\r\n"); remaining -= bytes; ptr += bytes; } Change the large number to read:-
if (httpp_getvar(client->parser, "x-flash-version")) { bytes = snprintf (ptr, remaining, "Content-Length: 221183499\r\n"); remaining -= bytes; ptr += bytes; }

Now kill any running icecast2 and stream source processes, recompile icecast2 with the usual './configure make make install', and re-run the server. The only change you'll see is that it now works when viewed through Internet Explorer 7! Our demo Icecast2 server has been patched, and so if you're using IE7 and click HERE you'll be able to hear the music.