Forum Moderators: open
and you have added a control where you can enter the point in time to jump to, like this
<form>
<input type="button" name="goto" value="Go To"
onclick="SkipTo(document.myMovie, document.forms[0].nSec.value);"/><input type="text" name="nSec">
</form>
then what you need is a javascript function that reads the movie's frame rate and multiplies that with the number of seconds entered. QT uses its own timescale; use the method GetTimeScale() to read it. The method SetTime() will make the player jump to the given place in the movie, calculated in QT timescale.
function SkipTo(myObj, nSec) {
myObj.SetTime(myObj.GetTimeScale() * nSec);
} If you want the player to skip a given number of secs, you'll need the GetTime() method:
function SkipTo(myObj, nSec) {
myObj.SetTime(myObj.GetTime() + myObj.GetTimeScale() * nSec);
} HTH
I have been trying 'window.onload' becuase i wanted the movie to skip to that place automatically... it didn't work. Now I tried that submit butto and still nothing happrns....
Here's my code:
<script language="javascript=">
function SkipTo(myObj, nSec) {
myObj.SetTime(myObj.GetTime() + myObj.GetTimeScale() * nSec);
}</script><input type="button" name="goto" value="Go To"
onclick="SkipTo(document.movieSlug, <?php
echo (isset($_GET['time']) && is_numeric($_GET['time']))?
$_GET['time'] : 5 ;
?>);"><?php
$src = $_GET["src"];$filename = ${src};
print "<OBJECT CLASSID=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" CODEBASE=\"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0\" id=\"movieSlug\">";
print "<PARAM name=\"SRC\" VALUE=\"{$filename}\">";
print "<PARAM name=\"AUTOPLAY\" VALUE=\"true\">";
print "<PARAM name=\"CONTROLLER\" VALUE=\"true\">";
print "<PARAM name=\"enablejavascript\" VALUE=\"true\">";
print "<embed src=\"{$filename}\" type=\"video/quicktime\" AUTOPLAY=\"true\" PLUGINSPAGE=\"http://www.apple.com/quicktime/download\" enablejavascript=\"true\">";
print "</embed></OBJECT>";
?>
and heres my link:
http://csebvideo.cs.funpic.org/?id=play_movie.php&src=http://images.apple.com/movies/wb/charliechocolat#*$!/charliechocolate-tlr_i320.mov&time=22//To fastworwrd 22 seconds as a test
note: for some reason the movie is cut off ina perfect square and missing stuff and the controller will not show up... I don't why thats happening