views:

114

answers:

2

I'm at a loss here--trying to come up with the best way to embed a video in a web page such that it can start playback at a specific frame number programmatically (not a simple timeline bar like youtube).

+2  A: 

You can use the ExternalInterface object to communicate between the ActionScript in a Flash movie and the JavaScript on a page. There's a nice tutorial here.

attack
Thanks, that looks perfect. What would be the best way to get an avi into flash?
You'll probably have to convert the AVI into a FLV. Also YouTube already supports playback starting at a specific timeframe, but I forget the URL syntax to check it out.
TravisO
A: 

I agree with Attack for the javascript+external interface.

If the movie you have is not interactive (i.e. the user cannot play with the time-line once it's started) is even easier to simply pass the start frame value via flash-vars (i.e. pass the frame in as a variable in the embed code of your HTML).

I just wanted to specify that importing a video directly on time-line is not very good practice for smooth playback and synced audio. It's alright if you have a little animation or so of course. You will also have to be careful that the frame you want to jump to has been properly preloaded before calling it.

If you have a bigger video you may prefer streaming it via RTMP, this enables to jump to a given frame without having to preload the whole beginning of the movie and also get a far better quality.

Theo.T