Managing Bandwidth - MACROMEDIA FLASH MEDIA SERVER 2-DEVELOPING MEDIA Develop Manual

Developing media applications
Table of Contents

Advertisement

Managing bandwidth

You can control the amount of data the server sends to each client by providing an
approximate bandwidth capacity. You can do so in several ways. One way is to configure the
capacity for the Flash Media Server in the configuration file (Config.xml). For more
information on this technique, see Managing Flash Media Server. Another way is to use
NetStream.receiveVideo()
third way to match the data flow with capacity is to use
side and
Client.setBandwidthLimit()
capacity.
Another option for managing bandwidth is, in Flash Player, the NetStream class provides
properties for playing Flash Video (FLV) files from Flash Media Server. An event handler
(
) is invoked when a status is changed or an error is posted in the NetStream. A
onStatus()
status message,
NetStream.Play.InsufficientBW
NetStream is slower than the normal speed.
Data can be slower than normal speed for many reasons. For example, the client can have
insufficient bandwidth or the server can be busy and not send data at the expected rate. The
status message,
NetStream.Play.InsufficientBW
the client can manage the situation. The
passed to the
onStatus()
Code property
NetStream.Play.InsufficientBW
For more information about Info objects, see Appendix A, "Client-Side Information Objects"
in the Client-Side ActionScript Language Reference for Flash Media Server 2.
The design can be as simple as displaying a warning message, as in the following:
ns = new NetStream(nc);
ns.onStatus = function(info){
if (info.code == "NetStream.Play.InsufficientBW")
trace("Warning: data is behind");
}
vid.attachVideo(ns);
ns.setBufferTime(2);
ns.play("foo", 0, -1, true);
92
Application Development Tips and Tricks
to specify the frame rate per second of the incoming video. A
on the server side to inform the server of the client's
NetStream.Play.InsufficientBW
handler as an Info object:
Level
warning
Camera.setQuality()
, shows that data playing through the
, provides feedback to the client so that
on the client
message is

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MEDIA SERVER 2-DEVELOPING MEDIA and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash media server 2

Table of Contents