I am trying to get the fron camera to work, but I am not sure exactly
how I am supposed to use the "getCamera" method...I used a slightly
modified version of Raff's code that he posted, some of the project
specific code was removed... Also, I am creating a tabbed program,
however whenever I switch tabs it attemps to relogin and the streem is
interrupted.
import
com.adobe.rtc.authentication.AdobeHSAuthenticator; import
com.adobe.rtc.clientManagers.MicrophoneManager; import
com.adobe.rtc.events.AuthenticationEvent; import
com.adobe.rtc.events.CollectionNodeEvent; import
com.adobe.rtc.events.ConnectSessionEvent; import
com.adobe.rtc.events.SessionEvent; import
com.adobe.rtc.events.SharedPropertyEvent; import
com.adobe.rtc.events.StreamEvent; import
com.adobe.rtc.messaging.UserRoles; import
com.adobe.rtc.session.ConnectSession; import
com.adobe.rtc.sharedManagers.descriptors.StreamDescriptor; import
com.adobe.rtc.sharedManagers.descriptors.UserDescriptor; import
com.adobe.rtc.sharedModel.SharedProperty; import
mx.core.IFlexDisplayObject; [Bindable] protected var
sess:ConnectSession; [Bindable] private var auth:AdobeHSAuthenticator;
private function init():void { if(sess==null){ auth = new
AdobeHSAuthenticator(); sess = new ConnectSession(); sess.authenticator
= auth; auth.userName=""; auth.password=""; auth.protocol = "rtmfp";
sess.roomURL="https://connectnow.acrobat.com/foobar/footest";
sess.authenticator=auth; sess.addEventListener(SessionEvent.ERROR,
onEventNotification);
sess.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE,
onEventNotification);
auth.addEventListener(AuthenticationEvent.AUTHENTICATION_FAILURE,
onEventNotification);
auth.addEventListener(AuthenticationEvent.AUTHENTICATION_SUCCESS,
onEventNotification); Camera.getCamera("1"); } if(!sess.isSynchronized)
{ sess.login(); } } /** * Process Events */ private function
onEventNotification(p_event:Event):void { if (p_event.type ==
SessionEvent.SYNCHRONIZATION_CHANGE) { if (sess.isSynchronized) {
webcamSub.subscribe(); webcamPub.publish(); audioSub.subscribe();
audioPub.publish(); camera.addChild(webcamSub); webcamSub.width =
camera.width; webcamSub.height = camera.height; if (
sess.userManager.myUserRole == UserRoles.OWNER ) {
sess.roomManager.autoPromote = true ; } } } }