动态缓冲技术

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(infoObjectbject) {”$"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[Šƒ¡[|