|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (6 bit)
|
Javascript (and to a lesser extent QuickTime) Problem
Hi,
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) 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. HTML Code:
<script language="javascript"> <!-- redirTime = document.narration.GetDuration()*1000; redirURL = "slides.php?slide=<?php echo $nextslide; ?>"; function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); } //--> </script> HTML Code:
<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" /> </OBJECT> |
|
|
|
|
|
#2 |
|
Staff
Premium Member
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
|
Is the script placed between the <head> </head> tags or in the body of the page?
Have you tested it in Firefox? If so did it come up with the same error?
__________________
Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row |
|
|
|
|
|
#3 |
|
Member (6 bit)
|
Thanks for the reply. Of course I had it in the head tag, and it was having the same buzz with firefox. It transpires one of the errors can be to do with the id and name of two different objects being the same ('narration') and so document.narration.someProperty returns a node, or something similar to what Ive said, (if sum1 can explain thisto me I'd be much obliged)
Ive got around it by storing the length of each clip in the db and propagating it into the meta tags. Thanks. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|