05-31-2012 07:51 AM
Hi All ,
How can i add video thumbnail from videos, these videos can be choosen from Playbook or by using camera.
I need to show the thumbnails of these videos.
I have tried several codes but me not getting any success.
protected function importVideo(event:MouseEvent):void
{
var file:File = File.userDirectory;
file.addEventListener(Event.SELECT, mediaSelectHandler);
file.browseForOpen("Select File To Import", [acceptableTypes]);
}
private function mediaSelectHandler(event:Event):void {
vd = new VideoDisplay();
vd.autoPlay = false;
vd.horizontalCenter = 0;
vd.verticalCenter = 0;
vd.source = event.currentTarget.nativePath;
this.stage.addChild(vd);
}
private function getSnapShot(event:MouseEvent):void{
var bd:BitmapData = new BitmapData(200, 200);
var matrix:Matrix = new Matrix();
bd.draw(vd, matrix);
//save to hard drive
var file:File = File.documentsDirectory;
var imgfile:File = file.resolvePath("SampleThumbe.jpg");
var jpegEncoder:JPEGEncoder = new JPEGEncoder(90);
var jpegStream:ByteArray = jpegEncoder.encode(bd);
var filestream:FileStream = new FileStream();
filestream.open(imgfile, FileMode.WRITE);
filestream.writeBytes(jpegStream, 0, jpegStream.length);
filestream.close();
}ThanksIn Advance.
06-05-2012 03:53 PM
I found a decent looking article explaining this from doing a search here.
Where are you getting hung up?
Regards,
Dustin
06-11-2012 02:16 AM
Hello Dmalik ,
This Example shows that how to get thumbnail image from Url link because it is attaching url to stream in video class object .
I want to get video thumbnail from my local device ,Ho can i do this.
I have tried many times , it is always return me white thumbnail image.
Thanks for your reply, Hope you can still help me.
Shashank