jeva39
08-16-2006, 10:51 AM
Hello:
I use this function in an Classic ASP (Not ASP.NET) page:
<script language="JavaScript" type="text/javascript">
function mp3(mediaURL,rpt,height,width){
CodeGen = ""
var mediaURL,rpt,height,width
CodeGen = '<object id=Player' + '\n' ;
CodeGen += 'codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' + '\n' ;
CodeGen += 'type=application/x-oleobject height=' + height + ' width=' + width + '\n' ;
CodeGen += ' standby="Loading Microsoft® Windows® Media Player components..." ' + '\n' ;
CodeGen += 'classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> ' + '\n' ;
CodeGen += '<param NAME="Filename" VALUE="' + mediaURL + '">' + '\n' ;
if ((height == 24) && (width == 299))
CodeGen += '<param NAME="ShowStatusBar" VALUE= "true">';
if ((height >= 50) && (width >= 200))
CodeGen += '<param NAME="ShowStatusBar" VALUE= "true">';
if ((height <= 49) && (width != 299))
CodeGen += '<param NAME="ShowStatusBar" VALUE= "false"> ';
CodeGen += '<param NAME="autoStart" VALUE="true"><param NAME="Volume" VALUE="-1">' + '\n' ;
CodeGen += '<param NAME="playCount" VALUE=' + rpt + '></object>'
document.write(CodeGen)
}
</script>
But when I call the function for example:
mp3("anyone.mp3",3,45,200)
the WMP is open in a new page, don't play anything and all the controls appear disabled. I check the file and location and are correct.
The page have more than 60 mp3 files (my own compositions) and I need a function that open any of the 60 files.
Please, who I can do?
Thanks in advanced!!
Jorge Villamizar, Panama
I use this function in an Classic ASP (Not ASP.NET) page:
<script language="JavaScript" type="text/javascript">
function mp3(mediaURL,rpt,height,width){
CodeGen = ""
var mediaURL,rpt,height,width
CodeGen = '<object id=Player' + '\n' ;
CodeGen += 'codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' + '\n' ;
CodeGen += 'type=application/x-oleobject height=' + height + ' width=' + width + '\n' ;
CodeGen += ' standby="Loading Microsoft® Windows® Media Player components..." ' + '\n' ;
CodeGen += 'classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> ' + '\n' ;
CodeGen += '<param NAME="Filename" VALUE="' + mediaURL + '">' + '\n' ;
if ((height == 24) && (width == 299))
CodeGen += '<param NAME="ShowStatusBar" VALUE= "true">';
if ((height >= 50) && (width >= 200))
CodeGen += '<param NAME="ShowStatusBar" VALUE= "true">';
if ((height <= 49) && (width != 299))
CodeGen += '<param NAME="ShowStatusBar" VALUE= "false"> ';
CodeGen += '<param NAME="autoStart" VALUE="true"><param NAME="Volume" VALUE="-1">' + '\n' ;
CodeGen += '<param NAME="playCount" VALUE=' + rpt + '></object>'
document.write(CodeGen)
}
</script>
But when I call the function for example:
mp3("anyone.mp3",3,45,200)
the WMP is open in a new page, don't play anything and all the controls appear disabled. I check the file and location and are correct.
The page have more than 60 mp3 files (my own compositions) and I need a function that open any of the 60 files.
Please, who I can do?
Thanks in advanced!!
Jorge Villamizar, Panama