User Guide
Stream class 157
Description
Method; sends a message to all clients subscribing to the stream and the message is processed
by the handler specified on the client. Because the server has higher priority than the clients,
the server can still send a message on a stream owned by a client. Unlike the
Stream.play()
method, the server does not need to take ownership of a stream from the client in order to
send a message. After
send() is called, the client still owns the stream as a publisher.
Example
The following example calls the method Test on the client-side Stream object and sends it the
string
"hello world":
application.streams["foo"].send("Test", "hello world");
The following example is the client-side ActionScript that receives the Stream.send call. The
method
Test is defined on the Stream object:
tStream.Test = function(str) {
// Insert code to process the str object.
}
Stream.setBufferTime()
Availability
Flash Communication Server MX 1.0.
Usage
myStream.setBufferTime()
Description
Method; increases the message queue length. When you play a stream from a remote server,
the
Stream.setBufferTime method sends a message to the remote server that adjusts the
length of the message queue. The default length of the message queue is 2 seconds. You
should set the buffer time higher when playing a high-quality recorded stream over a low-
bandwidth network.
When a user clicks a seek button in an application, buffered packets are sent to the server. The
buffered seeking in a Flash Media Server application occurs on the server; the Flash Media
Server doesn’t support client-side buffering. The seek time can be smaller or larger than the
buffer size, and it has no direct relationship to the buffer size. Every time the server receives a
seek request from Flash Player, it clears the message queue on the server. The server tries to
seek to the desired position and starts filling the queue again. At the same time, Flash Player
also clears its own buffer after a seek request, and the buffer is eventually filled after the server
starts sending the new messages.