client and send() method

Post your questions and bug-reports about our audio/video streaming add-on based on Red5 Server.

Moderators: Lapo, Bax

PePPeR
Posts: 40
Joined: 24 Aug 2011, 18:16

client and send() method

Postby PePPeR » 20 Dec 2012, 10:57

Trying to used netStream.send method for indicate if user on or off microphone and activity of it.
But for some reason it doens't work.
sender code send is bound to button and microphone is perfectly attaching and detaching, but for some reason on reciever i don't see any action bounded to netStream.client, even traces and no errors.

Code: Select all

      private function mic_btn_down(evt:MouseEvent)
      {
            if (playerStreams[myPlayerID - 1] != null)
            {
               (playerStreams[myPlayerID - 1] as NetStream).attachAudio(micSnd);
               (playerStreams[myPlayerID - 1] as NetStream).send("mic", { state: "on", pID: myPlayerID} );
               micSnd.addEventListener(ActivityEvent.ACTIVITY, micAct);
            }
      }
      private function mic_btn_up(evt:MouseEvent)
      {
            if (playerStreams[myPlayerID - 1] != null)
            {
               (playerStreams[myPlayerID - 1] as NetStream).attachAudio(null);
               (playerStreams[myPlayerID - 1] as NetStream).send("mic", { state: "off", pID: myPlayerID} );
               micSnd.removeEventListener(ActivityEvent.ACTIVITY, micAct);
            }
      }
      private function micAct(evt:ActivityEvent)
      {
         (playerStreams[myPlayerID - 1] as NetStream).send("talk", { pID: myPlayerID, actLev:micSnd.activityLevel } );
      }


Receiver

Code: Select all

      public function initListener(id:int)
      {
         var obj:Object = new Object();
         obj.mic = onMicSC;
         obj.talk = onTalk;
         streams[id].client = obj;
      }
      private function onTalk(obj:Object)
      {
         //obj.pID
         //obj.actLev
      
         trace("pID: " + obj.pID + " _ actLevel: " + obj.actLev);
      }
      //On microphone state change
      private function onMicSC(obj:Object)
      {
         trace("!@microphon state oN_oFF @!");
         if (obj.state == "on")
         {
            trace("micOn: " + obj.pID);
            micOn(obj.pID-1);
         } else {
            trace("micOff: " + obj.pID);
            micOff(obj.pID-1);
         }
      }

i'm using AVCastManager from RedBox
User avatar
Bax
Site Admin
Posts: 4395
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: client and send() method

Postby Bax » 21 Dec 2012, 09:10

This issue is not strictly related to SFS I suppose, because the RedBox API simply use the Flash API to connect to the media server.
Not sure how to help. Maybe you should investigate in some Flash support forum?
Paolo Bax
The SmartFoxServer Team
PePPeR
Posts: 40
Joined: 24 Aug 2011, 18:16

Re: client and send() method

Postby PePPeR » 21 Dec 2012, 11:20

Thank you. I found a lot of threads about problem with send method in Red5.

Return to “RedBox 2X”

Who is online

Users browsing this forum: No registered users and 1 guest