Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

preload quicktime

Status
Not open for further replies.

theocraticmind

Programmer
Apr 19, 2002
318
CA
Is it posible to preload a quicktime movie the way that you preload images?

thanks
 
Nope - Quicktime is an executable application.

There's always a better way...
 
Actually...

A lot depends on what you want to do.

Consider what "preloading images" actually means. The images are loaded, in theory, before the user is likely to mouseover the associated controls. The images are still downloaded to the client machine, but done so during a period of time when most users are busy doing something else, such as watching Sarah Michelle Gellar unfold.

So, can you "preload" a Quicktime movie in the same way?

Of course!

Let's say you've got a 3 meg movie on your web page. When do you want to have the client machine request it? Well, ideally, when the user isn't already tapping her fingers waiting. So, let's hit this from two different directions.

First, give the user something to read before even thinking about shoving 3M through the pipe. Some really eye-grabbing text or an introduction of sorts to the clip. Something that will take a minute or two to read. That gives you "free" time. You're downloading the Quicktime to the client box while the user's reading text.

Now, in the other direction, let's consider the interface. Do you just have a link to your Quicktime, such as
Code:
<a href=&quot;Nosehair.mov&quot;>Play my movie!</a>
? If so, you might be evil. [smile] Consider placing your movie in a DIV tag, and setting the code of the DIV tag directly after the &quot;delaying action&quot; text above. That means the browser will load the text, then load the movie. If the DIV tag is not visible, then you'll use something like
Code:
<input type=&quot;button&quot; value=&quot;Play my Movie!&quot; onclick=&quot;document.MovieDiv.visible='true';return true;&quot;></button>

It's possible that the browser won't load something if it's in a non-visible DIV, in which case, make the DIV visible, but make the movie object's height and width values = 1 pixel. You can use the fact that it's in a DIV tag to stick it somewhere weird on the web page, such at the very end. Then, your onclick event for your button would be placing the DIV in the new location and resizing it.

So, the practical result is, a person looks at the web page, reads for about thirty/forty seconds, clicks the &quot;Play my movie&quot; button and the movie almost immediately starts to play!

One caveat: Don't place your delaying text in the same table as your movie. The deal with tables is that all of a table's contents must be loaded before the table is displayed. (this is an excellent opportunity to learn CSS to make a no-table-required layout).

Those are the avenues I'd pursue.

Good luck!


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Thank you for your advice. Tables are for spread sheets. css is for web pages. ;) I alwready atempted the hidden div trick, but to no avail. as you said, it woulden't load. But this new method may just work. The video is for a sort of &quot;cnn-like&quot; app. jpg slides go round and round, but I also need the ability to load video slides. I've acomplished that (flash slides too), but large qt videos were taking time to load (and you know how impatient people watching tv are, worse then the net). But this may work. while the images are going by, the movie can nonshalontly load at position:absolute;left:-100opx;right:-1000px;width:1px;height:1px; and play, loaded, when it's thier time.
 
Yep!

That's &quot;preloading&quot; -- loading before the user needs it, while they're busy being distracted by bouncing, fleshy...er, ah, by very informative text. Yeah, informative text...

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top