
109
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
Parameters
sourceStreamName A String. The name of the source multicast stream.
Returns
If a MulticastStreamIngest instance already exists for this group with this stream name, it returns the existing one,
otherwise it creates a new MulticastStreamIngest instance.
Example
The following example is pseudocode that provides a high-level description of how to ingest a multicast stream,
convert it into a Stream object, record it, and play it.
// First, set up Stream instance that will play (and record) the multicast ingest.
var stream = Stream.get("mp4:multicast-ingest.f4v");
// Next, set up a server-side NetConnection and NetGroup to join the Flash Group
// where the desired multicast stream is being published.
var nc = new NetConnection();
nc.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
ng = new NetGroup(nc, groupspec);
ng.onStatus = ngStatusHandler;
}
};
nc.connect("rtmfp://<ams-introduction-server>...");
// Handle NetGroup status events; this simple example handles only the initial join.
function ngStatusHandler(info) {
if (info.code == "NetGroup.Connect.Success") {
// As soon as we've successfully joined the Group,
// attempt to start ingesting a multicast stream.
// Assume we know the stream name we want to ingest (sourceStreamName).
ingest = ng.getMulticastStreamIngest(sourceStreamName);
}
}
// At some later point (or directly in the ngStatusHandler above),
// play the multicast ingest.
stream.playFromGroup(ingest);
// The stream can be recorded locally.
stream.record();
...
stream.record(false); // And recording stopped.
// To stop playback of a multicast stream, pass the Boolean false.
stream.playFromGroup(false);
See also
Ingest, convert, and record a multicast stream
NetGroup.estimatedMemberCount
groupSpecifier.estimatedMemberCount
Commenti su questo manuale