
张小鱼
张小鱼
-
个人空间
相册
- 组别:管理员
- 性别:
- 来自:
- 积分:242
- 帖子:240
- 注册:
2007-12-26
|
动态缓冲技术
B]The rise of the dynamic buffering $"QåúÖ www.flash-bbs.comÁí}D[¡[| $"QåúÖ www.flash-bbs.comÁí}D[¡[| Using the onStatus event of our netStream object, we are able to recognise when the buffer is full or empty. So, we can set a starting buffer lenght and then, reached the buffer full status, we can set it to an higher value to exploit the bandwidth eventually in excess. If the buffer goes empty, we can lower the buffer lenght again to the starting value. The code is quite simple: $"QåúÖ www.flash-bbs.comÁí}D[¡[| $"QåúÖ www.flash-bbs.comÁí}D[¡[| $"QåúÖ www.flash-bbs.comÁí}D[¡[|
附件: 您所在的用户组无法下载或查看附件$"QåúÖ www.flash-bbs.comÁí}D[¡[|$"QåúÖ www.flash-bbs.comÁí}D[¡[|// Init$"QåúÖ www.flash-bbs.comÁí}D[¡[| ...$"QåúÖ www.flash-bbs.comÁí}D[¡[| startBL=2; mainBL=15; $"QåúÖ www.flash-bbs.comÁí}D[¡[| in_ns.setBufferTime(startBL);$"QåúÖ www.flash-bbs.comÁí}D[¡[| in_ns.onStatus = Status;$"QåúÖ www.flash-bbs.comÁí}D[¡[| $"QåúÖ www.flash-bbs.comÁí}D[¡[| function Status(infoObject bject) {$"QåúÖ www.flash-bbs.comÁí}D[¡[| if (infoObject["code"]=="NetStream.Buffer.Full"){in_ns.setBufferTime(mainBL);};$"QåúÖ www.flash-bbs.comÁí}D[¡[| if (infoObject["code"]=="NetStream.Buffer.Empty"){in_ns.setBufferTime(startBL);};$"QåúÖ www.flash-bbs.comÁí}D[¡[| };$"QåúÖ www.flash-bbs.comÁí}D[¡[|$"QåúÖ www.flash-bbs.comÁí}D[¡[|$"QåúÖ www.flash-bbs.comÁí}D[¡[|Let's take a look at the dynamic buffer behaviour$"QåúÖ www.flash-bbs.comÁí}D[¡[|
|