AoaoSo
Apr 5th 2006, 7:11 pm
Play flash and mpeg easily in your pages.
function FPly(url,wt,ht){
url=url.toLowerCase();
if(url.indexOf('.swf')>0){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+wt+'" height="'+ht+'" align="middle">');
document.write('<param name="movie" value="'+url+'" \/><param name="quality" value="high" \/><param name="menu" value="false">');
document.write('<embed src="'+url+'" quality="high" width="'+wt+'" height="'+ht+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" \/><\/object>');
}
if(url.indexof('.wma')>0||url.indexof('.wmv')||url.indexof('.mp3')||url.indexof('.mpeg')){
document.write('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="'+wt+'" height="'+ht+'"><param name="filename" value="'+url+'"/>');
document.write('<embed src="'+url+'" playcount="1" width="'+wt+'" height="'+ht+'"></embed></object>}
if(url.indexof('.rm')>0){
document.write('<embed name="rplayer" type="audio/x-pn-realaudio-plugin" src="'+url+'" controls="ControlPanel,StatusBar" width="'+wt+'" height="'+ht+'" autostart="true" loop="true"><\/embed>');
}
}
you can play some media(swf,mpeg,rm,rmvb,mp3,wmv) by using
<script>
FPly(banner.swf,468,60);
FPly(shake.mpeg,400,300);
</script>
function FPly(url,wt,ht){
url=url.toLowerCase();
if(url.indexOf('.swf')>0){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+wt+'" height="'+ht+'" align="middle">');
document.write('<param name="movie" value="'+url+'" \/><param name="quality" value="high" \/><param name="menu" value="false">');
document.write('<embed src="'+url+'" quality="high" width="'+wt+'" height="'+ht+'" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" \/><\/object>');
}
if(url.indexof('.wma')>0||url.indexof('.wmv')||url.indexof('.mp3')||url.indexof('.mpeg')){
document.write('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="'+wt+'" height="'+ht+'"><param name="filename" value="'+url+'"/>');
document.write('<embed src="'+url+'" playcount="1" width="'+wt+'" height="'+ht+'"></embed></object>}
if(url.indexof('.rm')>0){
document.write('<embed name="rplayer" type="audio/x-pn-realaudio-plugin" src="'+url+'" controls="ControlPanel,StatusBar" width="'+wt+'" height="'+ht+'" autostart="true" loop="true"><\/embed>');
}
}
you can play some media(swf,mpeg,rm,rmvb,mp3,wmv) by using
<script>
FPly(banner.swf,468,60);
FPly(shake.mpeg,400,300);
</script>