Tiny audio streamer
I found this javascript-controlled audio streamer I made a while ago. It weighs in at a massive 1.2k and is very basic. Maybe you could make it a personal challenge to make it smaller!
Download the swf here. (right click & save).
Source (AS2):
Main.as
MiniStreamer.as
How to use:
Basically you need to embed the swf at whatever size you would like the progress bar to be.
Then play or stop an mp3 using javascript calls playAudio(url); and stopAudio();.
HTML:
<script language=“javascript”>
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function playAudio() {
// ‘AudioStreamer’ is the id of the embedded swf
thisMovie(’AudioStreamer’).playAudio(’test.mp3′);
}
function stopAudio() {
thisMovie(’AudioStreamer’).stopAudio();
}
</script>
<script language=“javascript”>
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function playAudio() {
// ‘AudioStreamer’ is the id of the embedded swf
thisMovie(’AudioStreamer’).playAudio(’test.mp3′);
}
function stopAudio() {
thisMovie(’AudioStreamer’).stopAudio();
}
</script>

July 9th, 2008 at 3:20 pm
Do you have an example of this in use posted somewhere?