December 05, 2004
javascript controls of a quicktime movie
there might be nothing better in the world than finding little documented features in programs.
several weeks ago, i found some links and info for the embed tag with quicktime. ive kept looking for info as i have been developing.
i have iframes right now nested three deep and every time you wanted to skip around in the movie, you had to reload the iframe to set a new 'starttime' in the embed tag.
until today that is.
using google for a long time, i found several pages that continued to spoonfeed info on controlling qt through js. most of these (for some reason) referenced qt4.1, so that was encouraging. maybe.
at any rate, i found one page on ken villines site and one on another site.
a quick page showed that you can control jumping around a movie file with js. so i get to rip out that second iframe and hold my movie in the same frame as my stills. this is great news programatically, but even better it means you only have to load the movie once. thats a fantastic performance boost and exactly the solution i wanted.
i just cant believe this kind of thing isnt better documented.
(oh, the function i wanted looks like this: javascript:document.nameofmovie.SetTime(22000) where 22000 somehow translates to 22 seconds. since im not dealing with frames, this is cakewalk for me to implement. in fact, i was already passing the timecode to the iframe, so its just a matter of pointing it within the document instead of through a querystring.)
***
and if i could read (from the second link above, but way up on the page):
movname.SetTime(time) For .mov files time is indicated by number of frames- for example for a 6 frame per second movie setTime(30) would take it to 30th frame or 5 seconds. For sound the time is indicated in miliseconds - for example, 22000 (22x1000) would take it to 22th second. ** note this setting is different than the hour:minute:second:frame notation used in the embed tag.
Posted by tripp at December 5, 2004 09:29 PM