Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4560820
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:59:09+00:00 2026-05-21T17:59:09+00:00

I’m trying to practice making a simple video phone app so I’m trying to

  • 0

I’m trying to practice making a simple video phone app so I’m trying to make a program to send a video and recieve a video using Cirrus from Adobe. I’m having trouble recieving the stream though. Here is the cod that I’m using:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="init()">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>

    <fx:Script>
        <![CDATA[
            import mx.core.UIComponent;
            import mx.core.mx_internal;

            import spark.components.Group;
            private const SERVER:String = "rtmfp://p2p.rtmfp.net/";
            private const DEVKEY:String = "MY-DEV-KEY";

            [Bindable]
            //Net Connection variable
            private var netConnection:NetConnection;
            //Sending video stream var
            private var sendStream:NetStream;
            //Sending video video var
            private var videoSend:Video;
            //Receiving video stream var
            private var recvStream:NetStream;
            //String for getting their ID
            private var id_of_publishing_client:String;


            private function init():void {
                //Setup videoSend
                videoSend = new Video(320,240);
                videoSend.x = 10;
                videoSend.y = 10;
                var uic:UIComponent = new UIComponent();
                uic.addChild(videoSend);                            
                addElement(uic);
                //connect
                connect();
            }

            private function connect():void{
                netConnection = new NetConnection();
                netConnection.addEventListener(NetStatusEvent.NET_STATUS, netStreamHandler);
                netConnection.connect(SERVER,DEVKEY);
            }

            private function setupStreamOutgoing():void{
                //Send Stream setting up
                sendStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
                sendStream.addEventListener(NetStatusEvent.NET_STATUS,netStreamHandler);
                //setup camera
                var cam:Camera = Camera.getCamera();
                //attach the camera to the to the sendStream
                sendStream.attachCamera(cam);
                //publish the sendStream
                sendStream.publish("media");
                //attach the camera to the videoStream object
                videoSend.attachCamera(cam);
            }

            private function getVideoReceiver():void{
                id_of_publishing_client = theirID.text;
                writeText("inside getVideoReceiver()");
                if(id_of_publishing_client){
                    recvStream = new NetStream(netConnection, id_of_publishing_client);
                    recvStream.addEventListener(NetStatusEvent.NET_STATUS, netStreamHandler);
                    writeText("flag");
                    //play the recvStream
                    recvStream.play("media");
                    writeText("recvStream.play(media)");
                    //attach the stream to the myVid
                    myVid.mx_internal::videoPlayer.attachNetStream(recvStream);             
                }
                else {
                    theirID.text = "Please place an ID here.";
                }

            }

            private function netStreamHandler(event:NetStatusEvent):void{
                writeText(event.info.code);

                switch(event.info.code){
                    case "NetConnection.Connect.Success":
                        //Display my ID in myID.text 
                        myID.text = netConnection.nearID;
                        setupStreamOutgoing();
                        break;
                    case "NetStream.Connect.Success":
                        break;
                    case "NetStream.Connect.Closed":
                        break;

                }
            }

            private function writeText(txt:String):void{
                txtHistory.text += txt+"\n";
            }

        ]]>
    </fx:Script>

    <s:TextArea top="10" bottom="10" id="txtHistory" width="252" right="10"/>
    <s:TextInput id="theirID" x="112" y="342" width="437"/>
    <s:TextInput id="myID" x="112" y="312" width="437"/>
    <s:Button x="10" y="312" label="My Connection" width="94" />
    <s:Button x="10" y="341" label="Their Connection" width="94" click="getVideoReceiver()"/>
    <mx:VideoDisplay id="myVid" 
                     x="340"
                     y="10"
                     width="320" height="240" />
</s:Application>

Inside of the getVideoReveiver() function I’m getting the flag to go off from writeText("flag") then I get and output in the text box of:

NetStream.Play.Reset
NetStream.Play.Start

from the netStreamHandler, but the video never shows up in the receiving video element.

I’m running this is two different videos of the same computer and taking the nearID from one stream and pasting it into the textInput theirID. I’m not sure what to try next?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T17:59:10+00:00Added an answer on May 21, 2026 at 5:59 pm

    Here is the script that I got working for anyone who would like this as an example. All you need is a Cirrus dev key.

    <fx:Script>
        <![CDATA[
            import mx.core.UIComponent;
            import mx.core.mx_internal;
            import flash.display.MovieClip;
            import flash.events.*;
            import flash.net.*;
    
            import spark.components.Group;
            private const SERVER:String = "rtmfp://p2p.rtmfp.net/";
            private const DEVKEY:String = "YOUR-DEV-KEY";
    
            [Bindable]
            //Net Connection variable that is needed to s
            private var netConnection:NetConnection;
            //Sending video stream var
            private var sendStream:NetStream;
            //Sending video video var
            private var videoSend:Video;
            //receiving video video var
            private var videoRecv:Video;
            //Receiving video stream var
            private var recvStream:NetStream;
            //String for getting their ID
            private var id_of_publishing_client:String;
    
            private function init():void {
                //Setup videoSend
                videoSend = new Video(320,240);
                videoSend.x = 10;
                videoSend.y = 10;
                //Setup videoRecv
                videoRecv = new Video(320,240);
                videoRecv.x = 340;
                videoRecv.y = 10;
                var uic:UIComponent = new UIComponent();
                uic.addChild(videoSend);
                uic.addChild(videoRecv);
                addElement(uic);
                //connect to cirrus
                connect();
            }
    
            private function connect():void{
                netConnection = new NetConnection();
                netConnection.addEventListener(NetStatusEvent.NET_STATUS, netStreamHandler);
                netConnection.connect(SERVER,DEVKEY);
            }
    
            private function setupStreamOutgoing():void{
                //Send Stream setting up
                sendStream = new NetStream(netConnection, NetStream.DIRECT_CONNECTIONS);
                sendStream.addEventListener(NetStatusEvent.NET_STATUS,netStreamHandler);
                //setup camera
                var cam:Camera = Camera.getCamera();
                //attach the camera to the to the sendStream
                sendStream.attachCamera(cam);
                //publish the sendStream
                sendStream.publish("media");
                //attach the camera to the videoStream object
                videoSend.attachCamera(cam);
            }
    
            private function getVideoReceiver():void{
                id_of_publishing_client = theirID.text;
                writeText("inside getVideoReceiver()");
                if(id_of_publishing_client){
                    recvStream = new NetStream(netConnection, id_of_publishing_client);
                    recvStream.addEventListener(NetStatusEvent.NET_STATUS, netStreamHandler);
                    writeText("flag");
                    //play the recvStream
                    recvStream.play("media");
                    writeText("recvStream.play(media)");
                    //attach the stream videoRecv
                    videoRecv.attachNetStream(recvStream);
                    }
                else {
                    theirID.text = "Please place an ID here.";
                }
    
            }
    
            private function netStreamHandler(event:NetStatusEvent):void{
                writeText(event.info.code);
    
                switch(event.info.code){
                    case "NetConnection.Connect.Success":
                        //Display my ID in myID.text 
                        myID.text = netConnection.nearID;
                        setupStreamOutgoing();
                        break;
                    case "NetStream.Connect.Success":
                        break;
                    case "NetStream.Connect.Closed":
                        break;
                    case "NetStream.Play.Start":
                        break;
                }
            }
    
            private function writeText(txt:String):void{
                txtHistory.text += txt+"\n";
            }
    
        ]]>
    </fx:Script>
    
    <s:TextArea top="10" bottom="10" id="txtHistory" width="252" right="10"/>
    <s:TextInput id="theirID" x="112" y="342" width="437"/>
    <s:TextInput id="myID" x="112" y="312" width="437"/>
    <s:Button x="10" y="312" label="My Connection" width="94" />
    <s:Button x="10" y="341" label="Their Connection" width="94" click="getVideoReceiver()"/>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
We're building an app, our first using Rails 3, and we're having to build
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.