开发者

AS3: Showing bufferlength of NetStream

I am trying to show 开发者_如何学编程the buffered amount of a video that is playing. I am using netstream.bufferLength to do this and it kinda seems to be right. Exept from the fact that it is almost constantly the same amount that is buffered. This can't be right?

I want it to be like youtube where you can press pause and the buffer will continue to rise. When I click pause it just stays the same..

Anybody knows how to show buffer length?


you are getting confused between buffer which is a preloaded section of content that loads just infront of the current playcode, thus being a comparason to teh timecode you are at and the availablilty of instant playing and caching a loaded file which puts the whole file into temporary memory, so allowing for the loading as you described.

you can find the total loaded data (percentage) by using netstream.bytesLoaded / netstream.bytesTotal;


I'm pretty sure what you want is: NetStream.time + NetStream.bufferLength. As @shortstick mentioned - the buffer is related to the current play-position - you can regard the amount of time that was played as "already-buffered-and-used" - so the total amount of "buffered content" is:

NetStream.time + NetStream.bufferLength

I've used this, with good results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜