PDA

View Full Version : Open media in a new window



h2q1
11-18-2006, 07:09 AM
I'm doing a music online webpage !
I have a list music...and i want to play a song when I clicked a song in list and the music player should show in a new window...
Following the code :


<script type="text/javascript">

function rewrite() {
var newContent = "<html><body bgcolor=lavender>";
newContent += "<object classid='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6' id='id1'>";
newContent += "<param name='URL' value='2.mp3'>"
newContent += "</object></body></html>";

document.write(newContent);
// document.close();
}
function rewrite0() {
var newContent = "<html><body bgcolor=lavender>";
newContent += "<object classid='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6' id='id1'>";
newContent += "<param name='URL' value='bendoihiuquanh.mp3'>"
newContent += "</object></body></html>";

document.write(newContent);
// document.close();
}
</script>
</head>

<body>

<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="id1">
<param name="URL" value="">
<param name="rate" value="1">
<param name="balance" value="0">
<param name="currentPosition" value="0">
<param name="defaultFrame" value>
<param name="playCount" value="1">
<param name="autoStart" value="-1">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value>
<param name="volume" value="50">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="captioningID" value>
<param name="enableErrorDialogs" value="0">
</object>

<form>
<input type="button" value="3.mp3" onclick="rewrite0()"/>
<input type="button" value="2.mp3" onClick="rewrite()"/>
</form>


With this code, I can choose a button, but the song will be played in selfwindow...Please show me the way that play it in a new window ...

Thanks a lot !