views:

1156

answers:

1

Hi,

I have two FLV video players on a stage using two AS3 NetStream objects for playback. I need to have the two players synchronized, meaning that the playback should start when the buffer is full for both streams, and both should be paused when one of the buffers empties, waiting until refills again.

My problem is, that the buffering process of the second video starts only after the first stream is fully loaded (not only the bufferTime=5 sec, but the whole 10min). Is there any method to achieve this result, to buffer 5 sec from the first stream, then 5 sec from the second, and so on?

Thanks

+1  A: 

Supposing you are talking about progressive streams... You can actually preload them completely if needed and keep them in memory until needed.

To do so :

  • netStream.play() to start the loading
  • Catch the "NetStream.Play.Start" status event and pause() the stream directly (the loading will continue).
  • Thereafter you just have to check the bytesLoaded of both streams until you're happy with the amount of data to play them.
Theo.T
Thanks for the reply; yeah, I've already got this, my problem was that the second one started the buffering after the first one finished buffering (both are paused at the start). A few minutes ago I've noticed that the problem occurs only in Firefox/Chrome but in IE/Safari works just fine.. so I'm searching for the solution knowing this. Anyway, thanks again for your reply.
egyedg
Aw ok gottcha. Unfortunately I doubt you will fight the browsers interal loading behavior. It's a very interesting one though, thanks for spotting this out !
Theo.T