View Full Version : Javascript & Quicktime Problem

12-28-2005, 01:58 PM

I'm very much a newbie to javascript, I do a lot of php and need now a bit of javascript to control a narration on a website which is run as an mp3 thru the quicktime plug-in. The plug-in is working fine and I've written javascript to pause and play the narration through the pages own button.

The next task was to get it to move to the next slide after the narration has finished, so I decided to do a javascript re-direct after the time returned by the int GetDuration() command which the apple site says returns the length of the movie. (developer.apple.com...atsNew-74.html (http://developer.apple.com/documentation/QuickTime/REF/QT41_HTML/QT41WhatsNew-74.html))

However, it doesn't work, and IE keeps telling me "'redirTime' is undefined". The script is below, as is the embed tag for the movie.

<script language="javascript">
redirTime = document.narration.GetDuration()*1000;
redirURL = "slides.php?slide=<?php echo $nextslide; ?>";
function redirTimer() {
self.setTimeout("self.location.href = redirURL;",redirTime);

<body onLoad="redirTimer()">
<OBJECT classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="1" height="1" id="narration">
<PARAM name="src" value="<?php echo $narrationpath; ?>"><EMBED width="1" height="1" src="<?php echo $narrationpath; ?>" name="narration" loop="false" enablejavascript="true" />

I'm sure there's just some OOP thing i'm missing regarding variable names or something, as I said, javascript newbie! Thanks in advance for any help.


12-28-2005, 10:47 PM
I don't have quicktime but I'm pretty sure javascript isn't needed for what you want to do. Just make an m3u playlist. Read this post on how to do that. http://www.codingforums.com/showpost.php?p=287528&postcount=36