
64
Description
Method; calls a method on all the clients subscribing to a stream. When you call Stream.send on
the server side, any client publishing to that stream is stopped from publishing. Therefore, the
best practice is to create a new stream before calling
Stream.send. There should be one stream
for every communication call in a Flash Communication Server application.
Example
This 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
}
Note: Only the subscriber can send messages on a stream. Therefore, if you use the Stream.send method on the
server side to publish on a stream that is owned by a client, the server usurps the client’s ownership of the stream
and stops all play on that stream. Make sure that you safely own a stream before calling Stream.send on the server.
Stream.setBufferTime
Availability
Flash Communication Server MX.
Usage
Stream.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 Communication Server application occurs on the server; the Flash
Communication 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 the 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, the 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.
Commentaires sur ces manuels