Hi
Here is the code snippet where i am having problem at

<attribute name="_conn"/>
<attribute name="_sharedObject"/>

<attribute name="stream1" />
<attribute name="stream2" />

<videoview id="live" width="180" height="180" type="rtmp">
                <camera id="cam" capturing="true"/>
                <microphone id="mic" capturing="true"/>
               </videoview>

 <videoview id="broadcasting" width="180" height="180" autoplay="true"
type="rtmp"/>

<method name="initConnection"><![CDATA[
            //creating rtmpconnection
            this._conn = new NetConnection();
            //this.stream1= new NetStream(this._conn);

            this._conn.connect("rtmp://192.168.1.4/Red5SharedObject/");
            this._conn.client=this;
            this._sharedObject= new lz.sharedObject();

            //this.broadcastVideo();
            /*add the listeners accroding to the runtime */
            if ($swf8) {
                Debug.write("as2 env.");
                _conn.onStatus= function (info) {
                    if (info.code=="NetConnection.Connect.Success") {
                        Debug.write("The connection attempt succeeded.");
                    }
                }
            }

            else {
                Debug.write("as3 env.");
                this._conn.addEventListener(NetStatusEvent.NET_STATUS,
netStatusHandler);
                this._conn.addEventListener(AsyncErrorEvent.ASYNC_ERROR,
errorHandler);
                //this.stream1.addEventListener(NetStatusEvent.NET_STATUS,
streamHandler);
            }
            this._sharedObject.connect("chat", this._conn, false);

        ]]></method>

        <method name="netStatusHandler" args="event">
            switch (event.info.code) {
                case "NetConnection.Connect.Success":
                    Debug.write("The connection attempt succeeded.");
                    stream1= new NetStream(this._conn);
                    stream2= new NetStream(this._conn);
                    live.setAttribute("stream",stream1);
                    broadcasting.setAttribute("stream",stream2);
                    cam.setAttribute("show",true);
                    stream1.publish("broadcast","live");
                    stream2.play("broadcast");
                    break;
            }
        </method>

live => videoview of the stream which is publishing
broadcasting => videoview (should play the published stream)

When i try the code above, i canT see the video on the "broadcasting"
videoview. And i couldnT see where i m going wrong at.
Can anyone help me about that?

Regards
-- 
Cem SONMEZ

Reply via email to