Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News


2008 West
DIAMOND SPONSOR:
Data Direct
SOA, WOA and Cloud Computing: The New Frontier for Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
GOLD SPONSORS:
Appsense
User Environment Management – The Third Layer of the Desktop
Cordys
Cloud Computing for Business Agility
EMC
CMIS: A Multi-Vendor Proposal for a Service-Based Content Management Interoperability Standard
Freedom OSS
Practical SOA” Max Yankelevich
Intel
Architecting an Enterprise Service Router (ESR) – A Cost-Effective Way to Scale SOA Across the Enterprise
Sensedia
Return on Assests: Bringing Visibility to your SOA Strategy
Symantec
Managing Hybrid Endpoint Environments
VMWare
Game-Changing Technology for Enterprise Clouds and Applications
Click For 2008 West
Event Webcasts

2008 West
PLATINUM SPONSORS:
Appcelerator
Get ‘Rich’ Quick: Rapid Prototyping for RIA with ZERO Server Code
Keynote Systems
Designing for and Managing Performance in the New Frontier of Rich Internet Applications
GOLD SPONSORS:
ICEsoft
How Can AJAX Improve Homeland Security?
Isomorphic
Beyond Widgets: What a RIA Platform Should Offer
Oracle
REAs: Rich Enterprise Applications
Click For 2008 Event Webcasts
SYS-CON.TV
Top Links You Must Click On


Generating Thumbnail Previews Using Progressive FLVs
A workaround involving loading a non-existing FLV

We probably all know by now how to play a progressive FLV without Flashcom:

nc = new NetConnection();
nc.connect(null);
ns = new NetStream(my_nc);
ns.setBufferTime(0.1); // small buffer to limit motion in preview
my_video.attachVideo(ns); // my_video is a video object on stage
ns.play(thefile);

To turn this example into a thumbnail preview of the actual FLV you could do this:


ns.onStatus = function (info) {
if(info.code == "NetStream.Buffer.Full"){
ns.pause();
}
};
There's even a way of supressing the sound resulting in a silent preview:

// soundholder is a simple movieclip on stage
soundholder.attachAudio(ns);
audio = new Sound(soundholder);
audio.setVolume(0);

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:


ns.onStatus = function (info) {
if(info.code == "NetStream.Buffer.Full"){
my_video.attachVideo(null);
ns.pause();
ns.play("nonexist.flv");
}
};
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.

About Stefan Richter
Stefan Richter is a Certified Flash Developer and Team Macromedia member who has been involved with Flash Communication Server since its early days. As VP of Application Development and cofounder of POPview, he has developed a variety of Rich Internet Applications using Flash Communication Server, Flash MX 2004 and Coldfusion. You can find more of Stefan's articles at www.flashcomguru.com.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Enterprise Open Source Magazine Latest Stories . . .
With Cloud Expo 2012 New York (10th Cloud Expo) just four months away, what better time to start introducing you in greater detail to the distinguished individuals in our incredible Speaker Faculty for the technical and strategy sessions at the conference... We have technical and st...
AMD said late Tuesday that its chief sales officer Emilio Ghilardi had left the company and that CEO and president Rory Read is going to do his job while a replacement is sought. AMD didn’t say why Ghilardi left but it’s assumed Read wants his own people. Read is relatively new to th...
During the lifespan of M3 (Monitis Monitor Manager) there has always been something lacking – timers. M3 execution procedure was outlined in this previous article. The execution mentioned in the latter was a one-time-execution, whereas server monitoring requires periodic invocati...
Red Hat is putting its bought-in Gluster scale-out NAS storage technology, acquired in October, on the Amazon cloud. It’s styled Red Hat Virtual Storage Appliance for Amazon Web Services and other clouds are supposed to follow in short order.
A new episode of the screencast series is now available at the OpenNebula YouTube Channel. This screencast demonstrates the new easily-customizable self-service portal for cloud consumers. Its aim is to offer a simplified access to shared infrastructure for non-IT end users. The scree...
C12G Labs has just announced an update release of OpenNebulaPro, the enterprise edition of the OpenNebula Toolkit. OpenNebula 3.2, released two weeks ago, brings important benefits to cloud providers with a new easily-customizable self-service portal for cloud consumers, and builders w...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON Featured Whitepapers
ADS BY GOOGLE