Expand my Community achievements bar.

i want to any user use webcam and sound , but only userrole : "owner" can use it ,

Avatar

Level 2

Hello, so i want to any user use webcam and sound , but only userrole : "owner" can use it , then how i change this?

thanks,

Lionceau

1 Reply

Avatar

Employee

You can add webcam to owners only using the example below

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:authentication="com.adobe.rtc.authentication.*" xmlns:session="com.adobe.rtc.session.*" xmlns:pods="com.adobe.rtc.pods.*" xmlns:collabs="com.adobe.rtc.collaboration.*">
<mx:Script>
    <![CDATA[
        import com.adobe.rtc.pods.WebCamera;
        import com.adobe.rtc.messaging.UserRoles;
        import com.adobe.rtc.sharedManagers.UserManager;
        import com.adobe.rtc.pods.SharedWhiteBoard;
        import com.adobe.rtc.events.SessionEvent;
        protected function init():void
        {
            auth.userName = "uName@domain.com";
            auth.password = "password";
            sess.login();
            sess.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE, onLogin);
        }
       
        protected function onLogin(p_evt:SessionEvent):void
        {
//            trace(sess.userManager.userCollection.source);
//            trace(sess.authenticator.userName);
            if (sess.userManager.myUserRole == UserRoles.OWNER) {
                var webCam:WebCamera = new WebCamera();
                webCam.connectSession = sess;
                webCam.width = 300;
                webCam.height = 600;
                vBox.addChild(webCam);
                //webCam.subscribe();
            }
        }
    ]]>
</mx:Script>
    <authentication:AdobeHSAuthenticator id="auth"/>
    <session:ConnectSession id="sess" authenticator="{auth}" roomURL="http://connectnow.acrobat.com/uName/roomName"/>
    <mx:VBox id="vBox" width="100%" height="100%">
        <mx:Button id="click" label="Add WebCam" click="init()" />
    </mx:VBox>   
</mx:Application>