Javascript Changing SRC of EMBED Quicktime

P

Peter Stickney

All -

Not one to use js extensively, so I'll give this a shot. I've got a
site that wants to have a "video journal". I figure I could just use
JS to change which video is being played. A simple dropdown menu that
onChange would pass the selected option's value and change the src of
the embed / object to the given movie, the option's value is the
filename.

I don't have much, but I'll post what I have.

Forgive me if this issue has been discussed, I had not come across in
my searches.

Thanks

-peter

//// JS Function , thus far ////
function ChangeMovie() {
if ( navigator.appName== "Netscape" )
document.embeds["TheMovie"].src=document.MovieForm.movies.options[document.MovieForm.movies.options.selectedIndex].value;
else
document.all["TheMovie"].src=document.MovieForm.movies.options[document.MovieForm.movies.options.selectedIndex].value;
}

//// Embeded QT movie ////

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="150"
width="250" ID="TheMovie">
<param name="src" value="./videos/1.mov">
<param name="autoplay" value="true">
<param name="controller" value="true">
<embed height="150" width="250" src="./videos/1.mov"
pluginspage="http://www.apple.com/quicktime/download/"
type="video/quicktime" controller="true" autoplay="true"
name="TheMovie">
</object>

//// Drop Down List ////

<form name="MovieForm">
<select name="movies" size="1" onChange="ChangeMovie();">
<option>Choose Movie</option>
<option value="2.mov">Handy</option>
</select>
</form>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top