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.
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:collaboration="com.adobe.rtc.collaboration.*"
xmlns:authentication="com.adobe.rtc.authentication.*"
xmlns:rtc="http://ns.adobe.com/rtc"
xmlns:s="library://ns.adobe.com/flex/spark" title="test2" viewActivate="init()">
<fx:Declarations>
<collaboration:WebcamPublisher id="webcamPub" connectSession="{sess}"/>
<collaboration:WebcamSubscriber id="webcamSub" connectSession="{sess}" webcamPublisher="{webcamPub}"/>
<collaboration:AudioPublisher id="audioPub" connectSession="{sess}"/>
<collaboration:AudioSubscriber id="audioSub" connectSession="{sess}"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
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 ;
}
}
}
}
]]>
</fx:Script>
<s:Group width="100%" height="100%" id="group">
<s:SpriteVisualElement id="camera" x="0" y="0" width="100%" height="50%"/>
</s:Group>
</s:View>