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

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 110
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
108
s = Stream.get("testStream");
s.send("onMsg", "Hello World");
The following client-side ActionScript defines the method that handles the data passed on the testStream stream:
ns = new NetStream(nc);
ns.onMsg = function(str) {
trace(str); //"Hello World" is output
}
ns.play("testStream", -2, -1, 3);
The following example adds metadata to a live stream:
s = new Stream(nc);
s.onStatus = function(info){
if (info.code == "NetStream.Publish.Start"){
metaData = new Object();
metaData.title = "myStream";
metaData.width = 400;
metaData.height = 200;
this.send("@setDataFrame", "onMetaData", metaData);
}
};
s.publish("myStream");
Stream.setBufferTime()
myStream.setBufferTime()
Sets the length of the message queue. 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 0 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; Flash Media Server doesnt 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.
Availability
Flash Communication Server 1
Stream.setVirtualPath()
myStream.setVirtualPath(virtualPath, directory, virtualKey)
Sets the virtual directory path for video stream playback. Maps a virtual directory path to a physical directory and
assigns that mapping to a virtual key. The virtual key designates a range of Flash Player versions. These mappings let
you use the same URL to serve different versions of streams to clients based on the Flash Player version.
First, create a mapping between Flash Player versions and virtual keys in the
VirtualKeys section of the Vhost.xml
file. When Flash Player requests a stream from Flash Media Interactive Server, the Flash Player version is mapped to
a virtual key based on the values that you set in the Vhost.xml file, as in this example:
<VirtualKeys>
<!-- Create your own ranges and key values.-->
<!-- You can create as many Key elements as you need.-->
Vedere la pagina 110
1 2 ... 106 107 108 109 110 111 112 113 114 115 116 ... 154 155

Commenti su questo manuale

Nessun commento