86
Client-Side ActionScript Language Reference
Description
Property (read-only); the number of seconds assigned to the buffer by
NetStream.setBufferTime()
. The default value is 9. To determine the number of seconds
currently in the buffer, use
NetStream.bufferLength
.
Example
The following example dynamically creates a text field that displays information about the
number of seconds that are currently in the buffer. The text field also displays the buffer
length that the video is set to, and percentage of the buffer that is filled.
this.createTextField("buffer_txt", this.getNextHighestDepth(), 10, 10, 300,
22);
buffer_txt.html = true;
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
stream_ns.setBufferTime(3);
my_video.attachVideo(stream_ns);
stream_ns.play("video1.flv");
var buffer_interval:Number = setInterval(checkBufferTime, 100, stream_ns);
function checkBufferTime(my_ns:NetStream):Void {
var bufferPct:Number = Math.min(Math.round(my_ns.bufferLength/
my_ns.bufferTime 100), 100);
var output_str:String = "<textformat tabStops='[100,200]'>";
outp= "Length: "+my_ns.buffe"\t"+"Time:
"+my_ns.buf"\t"+"Buffer:"+bu"%";
outp= "</textformat>";
buffer_txt.htmlText = output_str;
}
If your SWF file includes a v2 component (version 2 of the Macromedia Component
Architecture), use the DepthManager class from the component framework instead of the
MovieClip.getNextHighestDepth()
method, which is used in this example.
See also
NetStream.bufferLength
,
NetStream.setBufferTime()
NO
T
E
The default value for Flash Media Server
bufferTime
property is different from the
default value for the standard ActionScript
bufferTime
property.
Содержание FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER...
Страница 1: ...Client Side ActionScript Language Reference for Flash Media Server 2...
Страница 4: ...4 Contents...
Страница 148: ...148 Client Side ActionScript Language Reference...