Welcome, Guest
  • Author Topic: Turn off cam of users  (Read 19015 times)

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Turn off cam of users
    « Reply #30 on: 10/20/05, 03:56 »
    Then, from your button, pass av1 not jip2.

    Jorge

    jepyssimo

    • Seasoned Programmer
    • ***
    • Posts: 118
      • View Profile
      • Email
    Re: Turn off cam of users
    « Reply #31 on: 10/20/05, 04:18 »
    ok, I modific:
    kickCam.onPress = function() {
       var userKickCam = this._parent.name;
       if (userKickCam != undefined) {
          trace("Close Cam "+userKickCam);
          _root.client_nc.call("closeCam", null, userKickCam);
       }
    };
    when I click, trace works "Close Cam av1", but again funtion does not work. Trace of funtion is again "cam  off" without "av1"

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Turn off cam of users
    « Reply #32 on: 10/20/05, 05:16 »
    Now trace the argument that is receiving Client.prototype.closeCam on server side (see trough the FlashCom Admin Panel)

    Jorge

    jepyssimo

    • Seasoned Programmer
    • ***
    • Posts: 118
      • View Profile
      • Email
    Re: Turn off cam of users
    « Reply #33 on: 10/20/05, 06:16 »
    I'm no luky and my bad englih does not help me. I try with:

    Client.prototype.closeCam = function(who, userKickCam) {
       for (i=0; i<application.clients.length; i++) {
          application.clients.call("closeCam", who, userKickCam);
       }
    };
    client_nc.closeCam = function(userKickCam) {
       _root[userKickCam].stopPublish();
       trace("cam "+userKickCam+" off");
    };
    kickCam.onPress = function() {
       var userKickCam = this._parent.name;
       if (userKickCam != undefined) {
          trace("Close Cam "+userKickCam);
          _root.client_nc.call("closeCam", null, userKickCam);
       }
    };

    but no change nothing :(
    « Last Edit: 10/20/05, 06:24 by jepyssimo »

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Turn off cam of users
    « Reply #34 on: 10/20/05, 06:34 »
    Your current workflow is as follow:

    1. kickCam.onPress call a server side function, passing the instance name of a cam
    2. server side Client.prototype.closeCam (that resides in main.asc, of course) receives the name of instance name of the cam and call Client side closeCam on every user connected
    3. every user connected executes client_nc.closeCam receiving the instance name of the cam as parameter

    Now in the three steps of this procces, the same argument is passed along (the name of the AVPresence component who should be closed) So the next step in debugging is to trace this argument in the three functions to see where this value is lost.

    Jorge

    jepyssimo

    • Seasoned Programmer
    • ***
    • Posts: 118
      • View Profile
      • Email
    Re: Turn off cam of users
    « Reply #35 on: 10/20/05, 07:27 »
    Sorry, I try it but I do not find it. After to post I try no1 time, ma more and more...

    jepyssimo

    • Seasoned Programmer
    • ***
    • Posts: 118
      • View Profile
      • Email
    Re: Turn off cam of users
    « Reply #36 on: 10/20/05, 10:24 »
    Jorge, when I click, with this:

    _root.client_nc.call("closeCam", null, userKickCam);

    ...I send name of cam (userkickCam) to main.asc.

    In main.asc I send name of cam to all users with this script:

    application.clients.call("closeCam", who, userKickCam);

    I don't understand where is problem.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Turn off cam of users
    « Reply #37 on: 10/20/05, 10:37 »
    Ok, step 2 of my previous post. Let's rewrite this function

    Client.prototype.closeCam = function(userKickCam) {
       trace("#Serverside closeCam# receives: "+userKickCam)
       for (i=0; i<application.clients.length; i++) {
          application.clients.call("closeCam", userKickCam);
       }
    };

    Open the FlashCom Admin Panel, login and see if the trace outputs the correct cam

    Jorge

    jepyssimo

    • Seasoned Programmer
    • ***
    • Posts: 118
      • View Profile
      • Email
    Re: Turn off cam of users
    « Reply #38 on: 10/20/05, 10:57 »
    Jorge, before I never use Live Log of Admin Panel. I did not know that it existed.
    OK, I have found it and it works:
    #Serverside closeCam# receives: av2

    but cam (av2) is again open after that I click on button

    jay

    • Jr. Programmer
    • **
    • Posts: 99
      • View Profile
    Re: Turn off cam of users
    « Reply #39 on: 10/20/05, 11:16 »
    jepy

    are you using the fcs video component or have you used an embedded video? I have done the same thing, but I dont use the avPresence. As I said I use an embedded video. this gives you the option of setting it up exacting as you want. For example I can turn off a users cam by closing the netStream connection at the click of a button.

    It sounds like you may want to try using an Embedded Video and not the AV component. You can just customize to your liking.

    Let me know if you need more help and I will try and do what I can.

    Good luck
    Jay

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Turn off cam of users
    « Reply #40 on: 10/20/05, 11:21 »
    Well, that was my first advice, and let you more control, but let's finish with this.

    Step 3 of my previous post.

    client_nc.closeCam = function(userKickCam) {
       trace(_root[userKickCam])
       _root[userKickCam].close()
       trace("cam "+userKickCam+" off");
    };

    Check the trace

    Jorge

    jepyssimo

    • Seasoned Programmer
    • ***
    • Posts: 118
      • View Profile
      • Email
    Re: Turn off cam of users
    « Reply #41 on: 10/20/05, 12:09 »
    No, does not works:

    Close Cam av2
    undefined
    cam  off

    jay

    • Jr. Programmer
    • **
    • Posts: 99
      • View Profile
    Re: Turn off cam of users
    « Reply #42 on: 10/20/05, 12:57 »
    Jepy

    Do you mind if I ask what the URL is to your chat room? I would like to take a look at it if you dont mind. Also, did you read my response to your problems and how I used the Embedded Video and not the AV Presence to solve this same problem.

    Thanks
    Jay

    jepyssimo

    • Seasoned Programmer
    • ***
    • Posts: 118
      • View Profile
      • Email
    Re: Turn off cam of users
    « Reply #43 on: 10/21/05, 07:25 »
    Jorge, I think that there is a error or in step2 or in step3, because or main.asc does not send in chat or chat does not reads.
    When I try to close trace:

    Close Cam av2
    undefined
    cam  off

    again don't find  av2

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Turn off cam of users
    « Reply #44 on: 10/21/05, 07:31 »
    Jepy: probably I'm not good explaining.
    Follow jay advice, I think he can help you.

    Jorge