How can I make flv start in the middle?
I'd like to make flv play like youtube - start from the middle of the video or skip to forward-spot without completing download the file.
We are now using any streaming 开发者_开发百科server. We only have http server.
Can we do that like youtube?
Thanks
Sam
Yes it is possible, provided you use one of the following techniques:
- with your webserver, apache, lighttpd, or nginx, you can install a so-called flv streaming module, see for instance http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd, or mod_flvx for apache
- if you can't install such a module, you can use your favorite server-side scripting language, such as PHP, as shown in http://www.flashcomguru.com/index.cfm/2005/11/2/Streaming-flv-video-via-PHP-take-two
For this to work, your FLV files need to contain keyframes indexed in the metadata header, which you need to inject using tools such as flvmeta or flvtool2.
Then you need to use a player that supports random-access seeking, like JWPLayer or pretty much all major open-source flash video players out there, where the feature should work out-of-the-box, especially if using a server module.
精彩评论