Change embeded video with link?

j.venning

In Runtime
Messages
220
Hi everyone, I have my desktop set to a HTML webpage as my background. When I log on, a music video plays in an embeded media player. Is there any way I can change the video by clicking a link beside it or something, i.e. by JavaScript or something? Here is the code for my player:

Code:
<OBJECT 
classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' 
codebase='http://activex.microsoft.com/activex/controls/ mplayer/en/nsmp2inf.cab#Version=5,1,52,701' type='application/x-oleobject' width="480" height="320"
standby='Loading Microsoft Windows Media Player components...' id='mediaPlayer'>
      <param name='fileName' value="D:\WINDOWS\Cascada.avi">
      <param name='animationatStart' value='1'>
      <param name='transparentatStart' value='1'>
      <param name='autoStart' value='1'>
      <param name='ShowControls' value='0'>
      <param name='ShowDisplay' value='0'>
      <param name='ShowStatusBar' value='0'>
      <param name='loop' value='0'>
      <EMBED
src="D:\WINDOWS\Cascada.avi" width="480" height="320" autostart='1' loop='0' type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/ en/download/'
id='mediaPlayer' displaysize='4' autosize='0' 
bgcolor='darkblue' showcontrols='0' showtracker='1' 
showdisplay='0' showstatusbar='0' videoborder3d='0' designtimesp='5311'>      </EMBED>
    </OBJECT>

Regards,
James.
 
Put that Object in a DIV and ID it with something like:

Code:
<div id="vid1">

Then set up a JS function like

Code:
function changevid(){
foo = document.GetElementByID("vid1")
foo.innerHTML = new video code here

Then link to that JS function

I haven't worked with DHTML for a while, so don't expect this to be bullet proof. Go ahead and google "getelementbyid" I'm pretty sure w3schools has a pretty nice tutorial on it.

If you're already familiar with Javascript, this should be plenty to get you going. If not, it never hurts to learn eh?

-Sam
 
Back
Top Bottom