MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 106

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 105
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
103
Controls the data source of a stream with an optional start time, duration, and reset flag to flush any previously
playing stream. Call
play() to do the following:
Chain streams between servers.
Create a hub to switch between live streams and recorded streams.
Combine steams into a recorded stream.
You can combine multiple streams to create a playlist for clients. The
Stream.play() method behaves a bit differ-
ently from the
NetStream.play() method on the client side. A server-side call to Stream.play() is similar to a
client-side call to
NetStream.publish(); it controls the source of data coming into a stream. When you call
Stream.play() on the server, the server becomes the publisher. Because the server has 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.
If any recorded streams are included in a server playlist, you cannot play the server playlist stream as a live stream.
Note: A stream that plays from a remote server by means of the NetConnection object is considered a live stream.
To delete a Stream object, use the
delete operator to mark the stream for deletion. The script engine deletes the
object during its garbage collection routine.
// Initialize the Stream object.
s = stream.get("foo");
// Play the stream.
s.play("name", p1, ... pN);
// Stop the stream.
s.play(false);
// Mark the Stream object for deletion during server garbage routine.
delete s;
Availability
Flash Communication Server 1
Parameters
streamName A string indicating the name of any published live stream, recorded stream, MP3 file, or MP4 file.
To play video files, specify the name of the stream without a file extension (for example,
"bolero"). To play back
MP3 or ID3 tags, you must precede the stream name with
mp3:or id3: (for example, "mp3:bolero"
or"id3:bolero"). To play H.264/AAC files, you must precede the stream name with mp4:. For example, to play the
file file1.m4v, specify
"mp4:file1.m4v".
Note: For H.264 media files, specify the full file name, including the file extension.
startTime A number indicating the start time of the stream playback, in seconds. If no value is specified, it is set
to -2. If
startTime is -2, the server tries to play a live stream with the name specified in streamName. If no live
stream is available, the server tries to play a recorded stream with the name specified in
streamName. If no recorded
stream is found, the server creates a live stream with the name specified in
streamName and waits for someone to
publish to that stream. If
startTime is -1, the server attempts to play a live stream with the name specified in
streamName and waits for a publisher if no specified live stream is available. If startTime is greater than or equal
to 0, the server plays the recorded stream with the name specified in
streamName, starting from the time given. If
no recorded stream is found, the
play() method is ignored. If a negative value other than -1 is specified, the server
interprets it as -2. This parameter is optional.
Vedere la pagina 105
1 2 ... 101 102 103 104 105 106 107 108 109 110 111 ... 154 155

Commenti su questo manuale

Nessun commento