tags:

views:

257

answers:

4

I have a requirement to play only a portion of a larger video file in Flash and I am wondering if this is possible in a dynamic way. We want to avoid having to cut up a larger video into smaller clips that will appear at different locations on the site.

thanks Michael

A: 

This may be a bit crude, but using certain screen capturing programs (such as Jing or even Screen Toaster) could do what you're looking for. It depends on the quality and automation you're looking for I suppose.

Daniel Gill
A: 

With a portion i assume you meant a time portion (not a geometrical one); that could be easily done with playing a little with cue point. The FLVPlayback component has enought magic to to that gracefully.

kajyr
+2  A: 

You can use NetStream.seek() and pass the offset in seconds (i.e. video start). Use the time property of the NetStream class to retrieve the playhead position.

euge1979
+1  A: 

It depends:) If you're using standard http delivery and just want to play a portion of a larger clip, but don't mind downloading the whole clip (or at least the portion from the beginning of the clip through the portion you want to play), then, as other answers describe, you can just load the clip using NetStream or fl.video.VideoPlayer, seek to the start of the portion you want to play, and call play().

If you're using Flash Media Server and streaming using RTMP, then you should be able to download/play from any point in the clip.

The slicing approach isn't a bad one, either (though more work on the transcoding end). It's worth mentioning, though I'm hesitant because I don't mean this to be a sales pitch - I work on the video player team at Ooyala. Our flash player allows you to seek to/play arbitrary portions of a video (with 10-15 second granularity). We do it by slicing up the video into many smaller chunks, which the player can then download independently. This approach is very doable, but you need the transcoding infrastructure to do this if you want to do it on any sort of scale. If you think this might make sense for you, might be worth coming and talking with us.

Scotty Allen