views:

180

answers:

2

I'm using videoDisplay MXML component for my Flex app.

I would like to autoload videos (in order to display the first frame) without automatically run them.

What's the easiest way to do it ?

thanks

A: 

There are 2 options:

a)FLV movie - set autoPlay="false" in VideoDisplay

b)Live stream - call player.play();player.stop() in this order

Cornel Creanga
I've already tried these 2 options and these are the results: 1) If the video doesn't start to play the videoDisplay is a small icon (video width and height are not loaded) and this is exactly what I want to avoid. 2) if I play and then stop, I've a small rumor coming from the frame audio. I could deactivate the sound and activate it again, but I was wondering if there is a more elegant solution. (maybe an MXML attribute for doing it ?)
Patrick
I know that that OSMF can do that but I never played with it. Maybe it can help you: http://forums.adobe.com/message/2684000#2684000
Cornel Creanga
well, I gave up on the elegant solution, and I solved with your answer (b). Not that verbose :) thanks
Patrick
A: 
player.addEventListener(VideoEvent.READY, readyHandler);
player.source = test.mp4;
player.load(); // if autoPlay is false

private function readyHandler(event:VideoEvent):void
{
   player.playheadTime = 0; //  triggers a seek to first frame
}
dazweeja