Question

I'm using the netstream and video object to play a video in flash. Specifically a mp4 video.

What I'm trying to do is start playing the file from a specific position (Ex. 20seconds).

However with netstreamObject.seek(20) doesn't work unless the stream has been loaded past 20seconds. Is there a way to specify starting to load at 20s? Or any other way of accomplishing this?

Was it helpful?

Solution

You can use some sort of CDN cache server (so the actual file will be served via this cache server) which support lighttpd, then you can seek ahead in the video.

OTHER TIPS

would it not be simpler to create a new version of the file starting at 20 seconds. this way there is less for the user to download.

try looking here http://www.winmend.com/file-splitter/

Josh

The short answer is, "You cannot seek past the download point in a progressive video." However, Akamai and other CDNs (for example, YouTube) have technology to allow seeking on progressive videos. This does not solve your problem, because it is proprietary server technology. In your situation, using only client code with no control over the files or streaming server, there is no way to seek until the file loads.

Yes, you can do this even on progressive, it's known as http pseudostreaming, look it up and you'll find tons of examples for this. Basically you need a piece on your server to recieve the request, in the initial request you'll add via a http header the start point, the server side will automatically move to that offset.

There are better ways now though. In my opinion RTMP sucks, it's very proprietary to Adobe and works over non-standard ports, so many users have issues with it. If you wanna get serious and do it right. Lookup the apache f4f module, adobe http dynamic streaming, and the f4fpackager. Setup a apache server according to Adobe's docs on the apache origin module, use the f4fpackager to chunkify your video/audio into segments. Now point your netstream to the f4m. Not only can you seek crazy fast, your also going over standard http, can use a plain old CDN to cache & server the requests, but you can also support multiple bit-rates for adaptive streaming.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top