skylabel
asked on
multiple links that plays video in embedded windows media player when clicked
<HTML><HEAD></HEAD>
<BODY>
<OBJECT ID='Player' width='320' height='240' CLASSID='CLSID:6BF52A52-39 4A-11d3-B1 53-00C04F7 9FAA6'>
<PARAM name='autoStart' value='True'>
<PARAM name='URL' value='http://www.mydoman.com/intro.asx'>
</OBJECT>
<SCRIPT LANGUAGE='JavaScript'>
Player.settings.setMode('l oop',true) ;
</SCRIPT>
</BODY></HTML>
The above code is used to embed a windows media player and loop a pre-determined video clip. It works fine. However, I want many links on the page, and depending on which link is pressed, the relevant movie should be played (on the same media player). So I tried to stick all the stuff between the object tags into a javascript function in the header section of the html page like so, but I'm stuck really early on.....
<script language="JavaScript">
function playvdo() {
document.write ("<OBJECT ID='Player' width='320' height='240' CLASSID='CLSID:6BF52A52-39 4A-11d3-B1 53-00C04F7 9FAA6'><PA RAM name='autoStart' value='True'><PARAM name='URL' value='http://www.citybroadcast.tv/intro.asx'></OBJECT>");
Player.settings.setMode("l oop",true) ;
}
</script>
and I have a link like this to call the function : <a href="javascript:playvdo() ">Click Me</a>
Now, there's something wrong already. I can't get even one video clip to work, let alone having multiple choices. Can someone help? Greatly Appreciated thanks.
<BODY>
<OBJECT ID='Player' width='320' height='240' CLASSID='CLSID:6BF52A52-39
<PARAM name='autoStart' value='True'>
<PARAM name='URL' value='http://www.mydoman.com/intro.asx'>
</OBJECT>
<SCRIPT LANGUAGE='JavaScript'>
Player.settings.setMode('l
</SCRIPT>
</BODY></HTML>
The above code is used to embed a windows media player and loop a pre-determined video clip. It works fine. However, I want many links on the page, and depending on which link is pressed, the relevant movie should be played (on the same media player). So I tried to stick all the stuff between the object tags into a javascript function in the header section of the html page like so, but I'm stuck really early on.....
<script language="JavaScript">
function playvdo() {
document.write ("<OBJECT ID='Player' width='320' height='240' CLASSID='CLSID:6BF52A52-39
Player.settings.setMode("l
}
</script>
and I have a link like this to call the function : <a href="javascript:playvdo()
Now, there's something wrong already. I can't get even one video clip to work, let alone having multiple choices. Can someone help? Greatly Appreciated thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i have a problem with this..i mean it works only when i preview it but when i save it and view it on my webpage the media players gone help?
could you show the entire code of how to make it work? i have a similar problem and i am trying to use this code, but is not working
thanks!
thanks!
ASKER
works great. Thanks.