MP3 Flash player
HejJeg har fundet en udemærket MP3 Flash player på denne adresse: http://info.webknecht.net/downloads/mp3Player.zip. Afspilleren virker sådan set udemærket, men når hele nummeret er loadet begynder sangen forfra (Ret irreterende).
Playereren består af tre filer:
----------------------
mp3.php
----------------------
<html><head>
<?php
/*
* Download from http://info.webknecht.net
Mp3-Player for streaming Tracks. Values for Filename, Titel, Band and streambuffer are received from HTTP-String.
Displays also current Play & Streamtime.
FILES:
getMp3.fla Flashfile to modify
getMp3.swf Mp3-Player
mp3.php Script to call [mp3.php?&file=test.mp3&band=bandname&track=titel&streambuffer=3]
staticTest.php Script with embedded Vars for testing
test.mp3 test Mp3
*/
// GET-parameters:
$file = $HTTP_GET_VARS['file'];
$band = $HTTP_GET_VARS['band'];
$track = $HTTP_GET_VARS['track'];
$streambuffer = $HTTP_GET_VARS['streambuffer'];
?>
<SCRIPT LANGUAGE=JavaScript>
<!--
<?php
echo "params = \"file=".$file."&streambuffer=".$streambuffer."&band=".$band."&track=".$track."\";\n";
?>
//-->
</SCRIPT>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"><title><?php echo $band." : ".$track?></title></head>
<body bgcolor="#003366" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll=no>
<script>
document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.writeln('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id=uploadflash WIDTH=300 HEIGHT=100>');
document.writeln('<PARAM NAME=movie VALUE="getMp3.swf?' + params + '"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#ffffff>');
document.writeln('<EMBED src="getMp3.swf?' + params + '" quality=high bgcolor=#ffffff WIDTH=300 HEIGHT=100 swliveconnect=true TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');
</script></body>
</html>
----------------------
staticTest.php
----------------------
<html>
<head>
<title>Mp3Player : TEST with embedded Vars</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<div align="center" ><a href="#" onClick="window.open('mp3.php?&file=test.mp3&band=band&track=track&streambuffer=3','pop','width=300,height=100,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,top=300,left=300')">OpenMp3Player</a></div>
</body>
</html>
----------------------
getMp3.fla
----------------------
// Mp3Player from www.info.webknecht.net
display._visible = 0;
_soundbuftime = 2;
createEmptyMovieClip ("m", 2);
mp3 = new Sound (eval (m));
mp3._soundbuftime = 2;
mp3.onLoad = function () {
this.start ();
};
_root.txt.text = unescape (_root.band) + ":\n'" + unescape (_root.track) + "'";
_root.onEnterFrame = function () {
if (mp3.position>0) {
_root.load.text = "";
_root.display._visible = 1;
currenttime = int(mp3.position/1000);
totaltime = int(mp3.duration/1000);
min = int(currenttime/60);
sec = currenttime-min*60;
sec = sec<10 ? "0" add String(sec) : String(sec);
min = min<10 ? "0" add String(min) : String(min);
totalmin = int(totaltime/60);
totalsec = totaltime-totalmin*60;
totalsec = totalsec<10 ? "0" add String(totalsec) : String(totalsec);
totalmin = totalmin<10 ? "0" add String(totalmin) : String(totalmin);
_root.display.total = totalmin+":"+totalsec;
_root.display.current = min+":"+sec;
} else {
loaded = int (mp3.getBytesLoaded () * 100 / mp3.getBytesTotal ());
_root.load.text = "loaded: " + loaded + " %";
}
};
mp3.loadSound (unescape (_root.file),1);