Skip to end of metadata
Go to start of metadata


Supported platforms

Adobe Flash



Mac OS




Operation flowchart

  1. The browser establishes a connection via Websocket and sends the publish command.
  2. the browser sends the WebRTC stream to the server.
  3. Flash Player connects to the server via the RTMP protocol and sends the play command.
  4. Flash Player receives the RTMP stream from the server.

Quick manual on testing

Publishing of a web camera stream to the server and playing it with Flash Player

1. For the test we use:

  • the demo server at
  • the Two Way Streaming web application in the Chrome browser to publish the stream
  • the Flash Streaming web application in the Internet Explorer browser to play the stream

2. Open the Two Way Streaming application. Click Connect, then Publish. Copy the identifier of the stream:

3. Install Flash Player. Open the page of the Flash Streaming web application, and allow running Flash in the browser:

4. Click the login button. When you see the "Connected" label, specify the identifier of the broadcast stream in the Play field:

5. Click the Start button in the Play field. The stream starts playing:

Call Flow

Below is the call flow when using the Flash Streaming example to play the stream


1. Establishing a connection to the server.

connect(); code

	private function connect():void{
		var url:String = StringUtil.trim(connectUrl.text);"connect " + url);
		nc = new NetConnection();
		//if (url.indexOf("rtmp") == 0){
		//	nc.objectEncoding = ObjectEncoding.AMF0;
		nc.client = this;
		nc.addEventListener(NetStatusEvent.NET_STATUS, handleConnectionStatus);				
		var obj:Object = new Object();
		obj.login = generateRandomString(20);
		obj.appKey  = "flashStreamingApp";

2. Receiving from the server an event confirming successful connection.

NetConnection.Connect.Success code

    private function handleConnectionStatus(event:NetStatusEvent):void{"handleConnectionStatus: ";				
		if ("NetConnection.Connect.Success"){"near id: "+nc.nearID);"far id: "+nc.farID);"Connection opened");
			disconnectBtn.visible = true;
			connectBtn.visible = false;
			playBtn.enabled = true;
			publishBtn.enabled = true;
		} else if ("NetConnection.Connect.Closed" ||"NetConnection.Connect.Failed"){					

3. Playing the stream.; code

    private function addListenerAndPlay():void{
		subscribeStreamObject = createStreamObject();;
		videoFarEnd.width = 320;
		videoFarEnd.height = 240;
		videoFarEnd.visible = true;

4. Receiving from the server an event confirming successful playing of the stream.

NetStream.Play.Start code

    private function handleSubscribeStreamStatus(event:NetStatusEvent):void{"handleSubscribeStreamStatus: ";
		switch ( {
			case "NetStream.Play.PublishNotify":
			case "NetStream.Play.Start": 
				playBtn.visible = false;
				stopBtn.enabled = true;
				stopBtn.visible = true;

5. Receiving the audio and video stream via RTMP

6. Stopping the playback of the stream.

stream.close(); code

	private function stop():void{
		if (subscribeStream != null) {
			stopBtn.enabled = false;
			subscribeStream = null;
		subscribeStreamObject = null;
		videoFarEnd.visible = false;

7. Receiving from the server an event confirming the playback of the stream is stopped.

NetStream.Play.Stop code

    private function handleSubscribeStreamStatus(event:NetStatusEvent):void{"handleSubscribeStreamStatus: ";
		switch ( {
			case "NetStream.Play.UnpublishNotify":
			case "NetStream.Play.Stop":
				playBtn.enabled = true;
				playBtn.visible = true;
				stopBtn.visible = false;
  • No labels