Good day!
I can get which part of file in bytes is loaded using netstream.bytesLoaded
, netstream.bytesTotal
, I can get the current playing position using netstream.time
. But I wa开发者_开发知识库nt to know how many seconds of video are already loaded (not the length of buffer, which remains constant).
The loaded size in bytes is not directly proportional to running time of the video.
Any help is really appriciated!
It depends on the video codec / compression strategy used. I would do something naive and estimate it based on:
var secondsOfBuffer:Number = duration * (bytesLoaded/bytesTotal) - playPosition;
this would give you a rough estimate assuming the video has been encoded in a streaming format.
精彩评论