Ryan and James are true - the correct way is probably to extract frames at boot / recode. But if this is not an option, you can choose to use your own default image / placeholder (something common or somehow suitable for all videos whose thumbs have not been shot yet), and just use DisplayDobject-VideoDisplay to capture, and then upload the frame to your server, for example:
<mx:Script> <![CDATA[ var captured:Boolean; private function creationCompleteHandler(event:Event):void { videoDisplay.source = "http://yourserver/yourvideo.flv"; } private function videoDisplay_playheadUpdate(event:VideoEvent):void { if (!captured && videoDisplay.playheadTime >= 10) capture(); } private function capture():void { var bmpData:BitmapData = new BitmapData(videoDisplay.width, videoDisplay.height); bmpData.draw(videoDisplay); captured = true;
Again, this may not be the most elegant solution, but it certainly works. Thus, the first user sees the overall image, but each user after that receives the generated thumbnail. (Which, of course, you will be loaded and properly connected by then.) Do you make sense?
Chris nunciato
source share