What's the most effective and broadly compatible way to swap embedded Quicktime movies on a web page? I've written my own JavaScript to do so, but it doesn't work on certain (a minority of) browsers, and it's a bit slow. Does anyone have experience doing this?
See my first attempt
here. When the page is loaded for the first time, the banana should be shown. When a button is clicked, the video in question should start playing. When the other button is clicked, the first video should be replaced by the second, which should start playing from the beginning. This works on
most browsers, but doesn't work on at least Safari 1.0 (though Safari 2) is fine. I'm not worried about IE5 and the like, but using Javascript and Quicktime is so complicated that I need to be confident that I'm using a method that will work crossbrowser.
What my current script does (it's easy to read in the source if you want to):
1) The DIV that the Quicktime embed is in starts with its CSS visibility set to hidden. When a link is clicked, it's set to "visible".
2) Using the SetURL method recommended by Apple in the
Javascript Scripting Guide to Quicktime, the URL of the embed is changed to the new video's URL.
Unfortunately, some browsers are happier about doing this than others -- until I added some delays, I had reports that on some computers running IE6 (but not all), the video stage would appear but not change URLs, which suggested to me that the script was getting ahead of itself, but I added some delays. Still, Safari 1.0 doesn't seem to respond to SetURL() at all (speaking of which, is there somewhere I can find a copy of Safari 1.0 that will run under Tiger?), and the delay is still really just a kludge.
Anyone have an ideas for a better and more reliable way to do this that wouldn't require changing layout of the page? (I'm committed to having that video area swap in and out.) I'd much appreciate it -- thanks!
posted by null terminated at 10:15 AM on January 9, 2006