|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Flash Generating Thumbnail Previews Using Progressive FLVs
A workaround involving loading a non-existing FLV
By: Stefan Richter
Oct. 18, 2005 09:00 AM
We probably all know by now how to play a progressive FLV without Flashcom:
To turn this example into a thumbnail preview of the actual FLV you could do this: There's even a way of supressing the sound resulting in a silent preview:
// soundholder is a simple movieclip on stage You don't have to be a rocket scientist to take this example further using a 'play' button and kicking the video plus sound into life upon click. But what's not so obvious is the fact that even if you pause the video, the FLV file will load in its entirety in the background, potentially clogging up a user's connection. This is even more of an issue if you want to display many previews at once. I found out about this behavior using a neat little program called Netlimiter (www.netlimiter.com/). It allows you to see which applications are using what kind of bandwidth and it also enables you to throttle a fast connection on a per application basis, emulating dialup users for example. I thought it would be easy enough to stop the FLV downloading by killing the NetConnection or close the NetStream similar to how this would work using Flashcom. Unfortunately I had no success with that approach, the FLV would continue downloading come what may. Fortunately the workaround was surprisingly easy: try loading a non-existing FLV. Here's the code I used: This seems to do the trick quite nicely, showing one frame of the previously loaded FLV without clearing the video object. A typical preview consumed only about 5 to 10 KB of data -- a big saving over a whole flv file which is potentially several MB in size. The source for the finished example is here: www.flashcomguru.co.uk/downloads/flv_preview.zip The sourcecode is a bit messy but I didn't have time to clean it up. Let me emphasize again: if you only have a single FLV file on your page then the background download can be a great feature and even improve the user experience. But if you want to preview many different FLV files on one page then I recommend you use my approach above. Hope this helps someone. Reader Feedback: Page 1 of 1
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||