
70
You can also specify a number value of 2 or 3 for the reset parameter, which is useful when
playing recorded stream files that contain message data. These values are analogous to
false (0)
and true (1), respectively: a value of 2 maintains a playlist, and a value of 3 resets the playlist.
However, the difference is that specifying either
2 or 3 for reset returns all messages in the
specified recorded stream at once, rather than at the intervals which the messages were originally
recorded (the default behavior).
For more information on Flash Communication Server logging see Flash Communication Server
TechNote 16464 on the Macromedia Flash Communication Server Support Center,
www.macromedia.com/support/flashcom/ts/documents/flashcom_logging.htm.
remoteConnection A reference to a NetConnection object that is used to connect to a remote
server. The requested stream plays from the remote server if this parameter is provided. This
parameter is optional.
Returns
A Boolean value: true if the Stream.play call is accepted by the server and added to the playlist;
false otherwise. The Stream.play method can fail if the server fails to find the stream or if an
error occurs. To get information about the
Stream.play call, you can define a Stream.onStatus
handler to catch the play status or error.
If the
streamName parameter is false, the stream stops playing. A Boolean value of true is
returned if the stop succeeds;
false otherwise.
Description
Method; controls the data source of a stream with an optional start time, duration, and reset flag
to flush any previously playing stream. The
Stream.play method also has a parameter that lets
you reference a NetConnection object to play a stream from another server. The Stream.play
method allows you to do the following:
• Chain streams between servers.
• Create a hub to switch between live streams and recorded streams.
• Combine different steams into a recorded stream.
You can combine multiple streams to create a playlist for clients. The server-side Stream.play
method behaves a bit differently than the
NetStream.play method on the client side. A play call
on the server is similar to a
publish call on the client. It controls the source of the data that is
coming into a stream. When you call Stream.play on the server, the server becomes the
publisher. Because the server has a higher priority than the client, the client is forced to unpublish
from the stream if the server calls a
play method on the same stream.
In general, if any recorded streams are included in a server playlist, you cannot play the server
stream as a live stream.
Note: A stream that plays from a remote server by means of the NetConnection object is a live stream.
If you require a value to begin a stream, you may need to change the Application.xml file’s
“Enhanced seeking” flag at the server. “Enhanced seeking” is a Boolean flag in the
Application.xml file. By default, this flag is set to
false. When a play occurs, the server seeks to
the closest video keyframe possible and starts from that keyframe. For example, if you want to
play at time 15, and there are keyframes only at time 11 and time 17, seeking will start from time
17 instead of time 15. This is an approximate seeking method that works well with compressed
streams.
Komentarze do niniejszej Instrukcji