
100
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Call NetConnection.connect() to do any of the following:
• (Flash Media Server 1.0) Connect over HTTP to an application server, such as Adobe® ColdFusion®, running a Flash
Remoting gateway.
Note: You cannot use HTTP to connect to another Adobe Media Server or to media assets.
• (Flash Media Server 3.0) Multi-point publishing over RTMP/S. Connect over RTMP/S to another Adobe Media
Server and publish a stream to the server.
• (Flash Media Server 4.0) Multi-point publishing over RTMFP. Connect over RTMFP to an application on the same
server or on another Adobe Media Server and publish a stream to the server.
Create a server-side NetConnection, connect to the target server with an RTMFP URI (for example,
"rtmfp://ams.example.com/myapp"). Then create a NetStream without passing a GroupSpecifier string as a
constructor argument. This technique is traditional multi-point publishing but over an RTMFP connection.
• (Flash Media Server 4.0) Publish a live stream into a NetGroup. Connect over RTMFP to the current application or
to an application on another Adobe Media Server.
After you create an RTMFP NetConnection, use a GroupSpecifier to create a NetGroup and a NetStream. The
server application joins a group and becomes a peer in the group mesh. A single client can join multiple groups.
Once connected, you can interact with other peers in the group and publish into the group. Use this technique to
ingest a live stream and publish it into a group.
Note: Server-Side ActionScript doesn't support opening an RTMFP NetConnection directly to a client peer
(
DIRECT_CONNECTIONS in the client API).
• (Flash Media Server 4.5) Pass the string "rtmfp:" to create a serverless network endpoint for RTMFP
communication. This mode can be used only for RTMFP groups; it cannot be used for direct connections.
This mode is more fault-tolerate and supports the ability to cluster servers via RTMFP with no single point of
failure. See
Distribute introductions across servers.
It is good practice to write an application.onStatus() callback function and check the
NetConnection.isConnected property for RTMP connections to see whether a successful connection was made. For
Action Message Format (AMF) connections, check
NetConnection.onStatus().
Availability
Flash Communication Server 1
Parameters
URI A string indicating a URI to connect to. URI has the following format:
[protocol://]host[:port]/appName[/instanceName]
The following are legal URIs:
http://appserver.mydomain.com/webapp
rtmp://ams.mydomain.com/realtimeapp
rtmps://ams.mydomain.com/secureapp
rtmp://localhost/realtimeApp
rtmp:/realtimeApp
rtmfp://ams.mydomain.com/p2papp
rtmfp://
p1, ..., pN Optional parameters that can be of any ActionScript type, including references to other ActionScript
objects. These parameters are sent as connection parameters to the
application.onConnect() event handler for
RTMP connections. For AMF connections to application servers, RTMP parameters are ignored.
Kommentare zu diesen Handbüchern