charles22
Nov 17th, 2010, 07:16 AM
Hi All,
Can anyone here help me to resolve my problem?
Problem: I have 10 links on my webpage which opens different media files. When I embed all those media files my webpage takes too much time to load.
My requirement: To overcome this what I need is I will place 10 different hypertexts (images), which when clicked will open another page (Play_Chord.html) in which the media file will be played. Opening a window on click is easy but where I am stuck is I need to pass the value (media file name) to the new window (which will open) so that it can play that media file.
I am new to javascript I have searched it net but could not get the working solution.
My Code (Main.html)
<html>
<head>
<script language="javascript">
function OpenPlayer(File_Name)
{
var w=400;
var h=200;
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
window.open ("http://mywebsite.com/Play_Chord.html", 'mywindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
</head>
<body>
<img src="http://mywebsite.com/abcd.jpg" border=0 title="abcd" onClick = " OpenPlayer ('C-Maj.mid')" ></a>
</body>
</html>
My Code (Play_Chord.html)
<html>
<head>
</head>
<body>
<object id="MediaPlayer1"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft® Windows® Media Player components..."
type="application/x-oleobject" align="middle">
<param name="FileName" value="http://mywebsite.com/File_Name.mid">
<param name="autostart" VALUE="false">
<param name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<param name="ShowDisplay" VALUE="false">
<param name="AutoRewind" VALUE="true">
<embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"
src="http://mywebsite.com/File_Name.mid"
autostart="true" align="middle" width="100" height="45" defaultframe="rightFrame" showstatusbar="false">
</embed>
</object>
</body>
</html>
Please help
Charles
Can anyone here help me to resolve my problem?
Problem: I have 10 links on my webpage which opens different media files. When I embed all those media files my webpage takes too much time to load.
My requirement: To overcome this what I need is I will place 10 different hypertexts (images), which when clicked will open another page (Play_Chord.html) in which the media file will be played. Opening a window on click is easy but where I am stuck is I need to pass the value (media file name) to the new window (which will open) so that it can play that media file.
I am new to javascript I have searched it net but could not get the working solution.
My Code (Main.html)
<html>
<head>
<script language="javascript">
function OpenPlayer(File_Name)
{
var w=400;
var h=200;
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
window.open ("http://mywebsite.com/Play_Chord.html", 'mywindow', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
</script>
</head>
<body>
<img src="http://mywebsite.com/abcd.jpg" border=0 title="abcd" onClick = " OpenPlayer ('C-Maj.mid')" ></a>
</body>
</html>
My Code (Play_Chord.html)
<html>
<head>
</head>
<body>
<object id="MediaPlayer1"
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft® Windows® Media Player components..."
type="application/x-oleobject" align="middle">
<param name="FileName" value="http://mywebsite.com/File_Name.mid">
<param name="autostart" VALUE="false">
<param name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<param name="ShowDisplay" VALUE="false">
<param name="AutoRewind" VALUE="true">
<embed type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/MediaPlayer/"
src="http://mywebsite.com/File_Name.mid"
autostart="true" align="middle" width="100" height="45" defaultframe="rightFrame" showstatusbar="false">
</embed>
</object>
</body>
</html>
Please help
Charles