Flash AS3: NetStream buffer control
I have two FLV video players on a stage using two AS3 NetStream objects for pla开发者_运维知识库yback. 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
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.
精彩评论