Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

ScreenSharing questions

Avatar

Level 2

Hi!

While testing ScreenSharing feature i've found some things that is not clear for me:

1. Why screen sharing stream descriptor has different publisher ID than publisher's user ID? I've compared StreamDescriptor.streamPublisherID and UserManager.myUserID and there are different values. For me was WCD-4A5D5B****0BC27B992016B6/25 and WCD-4A5D5B****0BC27B992016B6/24

2. How can I see own screen sharing picture? I've created test app and publisher can't see own screen, but anyone else can.

3. Why screen sharing stream can be not shown at SDK Navigator's console? I've launched screensharing many times and have not seen any registered streams in Room Console.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Sorry, that's a lot for us to debug here - I do know for sure that there's

nothing that prevents a simple app with a pub and sub from working. I'm

guessing there's something wrong with the combobox code.

You're right that you can only screenshare once at a time per computer.

This is a limitation we don't really have much control over - only one addin

can successfully launch at once.

thanks

nigel

View solution in original post

4 Replies

Avatar

Former Community Member

Hi There,

1) Unfortunately, in order to screenshare, the addin needs to create

another connection to the service. You should be able to use

StreamDescriptor.originalScreenPublisher to do comparisons with myUserID.

2) This should work - add a ScreenShareSubscriber to the same app as the

publisher, and it will display the screen (in a "hall of mirrors" effect,

since you'll be sharing that as well!).

3) We just haven't gotten to this yet. We'll add this as a feature request

for a future release.

thanks for taking the time to write!

nigel

Avatar

Level 2

Here is test application that i am writing fr blog post about LCCS:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                  xmlns:s="library://ns.adobe.com/flex/spark"
                  xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" xmlns:rtc="http://ns.adobe.com/rtc" xmlns:collaboration="com.adobe.rtc.collaboration.*">
     <fx:Script>
          <![CDATA[
               import com.adobe.rtc.collaboration.AudioSubscriber;
               import com.adobe.rtc.collaboration.ScreenShareSubscriber;
               import com.adobe.rtc.collaboration.WebcamSubscriber;
               import com.adobe.rtc.events.CollectionNodeEvent;
               import com.adobe.rtc.events.SessionEvent;
               import com.adobe.rtc.events.StreamEvent;
               import com.adobe.rtc.messaging.UserRoles;
               import com.adobe.rtc.sharedManagers.StreamManager;
               import com.adobe.rtc.sharedManagers.descriptors.StreamDescriptor;
               
               import mx.collections.ArrayList;
               import mx.core.BitmapAsset;
               import mx.events.FlexEvent;
               
               import spark.events.IndexChangeEvent;
               import spark.primitives.Graphic;
               private var _subscriber:ScreenShareSubscriber;
               protected function session_synchronizationChangeHandler(event:SessionEvent):void{
                    if(!this.session.isSynchronized) return;
                    this.session.streamManager.addEventListener(StreamEvent.STREAM_RECEIVE, this.streamManager_updateHandler);
                    this.session.streamManager.addEventListener(StreamEvent.STREAM_DELETE, this.streamManager_updateHandler);
                    this.currentState = 'work';
                    this.updateUserList();
               }
               protected function publishButton_clickHandler(event:MouseEvent):void{
                    if(this.publishButton.selected){
                         if(!this.publisher.isPublishing){
                              this.publisher.publish();
                         }
                    }else{
                         if(this.publisher.isPublishing){
                              try{
                                   this.publisher.stop();
                              }catch(error:Error){}
                         }
                    }
               }
               protected function streamManager_updateHandler(event:StreamEvent):void{
                    this.updateUserList();
               }
               protected function updateUserList():void{
                    var streams:Object = this.session.streamManager.getStreamsOfType(StreamManager.SCREENSHARE_STREAM);
                    var list:Array = [{id:'Don\'t show any'}];
                    var selectedId:String = this.streams.selectedItem ? (this.streams.selectedItem as StreamDescriptor).id : '';
                    var selectedIndex:int = -1;
                    for each(var descriptor:StreamDescriptor in streams){

                                        if(selectedId==descriptor.id){
                              selectedIndex = list.length;
                         }
                         list.push(descriptor);
                    }
                    this.streams.dataProvider = new ArrayList(list);
                    this.streams.selectedIndex = selectedIndex;
               }
               protected function streams_changeHandler(event:IndexChangeEvent):void{
                    if(this._subscriber){
                         this._subscriber.close();
                         this.group.removeElement(this._subscriber);
                    }
                    var item:StreamDescriptor = this.streams.selectedItem as StreamDescriptor;
                    if(item){
                         this._subscriber = new ScreenShareSubscriber();
                         this._subscriber.percentWidth = 100;
                         this._subscriber.percentHeight = 100;
                         this._subscriber.connectSession = this.session;
                         this._subscriber.publisherID = item.streamPublisherID;
                         this._subscriber.subscribe();
                         this.group.addElement(this._subscriber);
                    }
               }
          ]]>
     </fx:Script>
     <fx:Declarations>
          <rtc:AdobeHSAuthenticator id="auth" userName="*********" password="*******"/>
     </fx:Declarations>
     <s:states>
          <s:State name="login"/>
          <s:State name="work"/>
     </s:states>
     <rtc:ConnectSessionContainer id="session" roomURL="https://collaboration.adobelivecycle.com/*******" authenticator="{this.auth}" width="100%" height="100%" synchronizationChange="session_synchronizationChangeHandler(event)">
          <s:VGroup width="100%" height="100%" id="group" verticalAlign="top">
               <!---
               Publisher -->
               <rtc:ScreenSharePublisher id="publisher" playerVersion="10"/>
               <s:HGroup width="100%" verticalAlign="middle" paddingLeft="10" paddingRight="10">
                    <s:Label text="Select ScreenShare stream from list: " maxDisplayedLines="1"/>
                    <s:ComboBox id="streams" labelField="id" change="streams_changeHandler(event)" width="100%"/>
                    <s:Label text=" or " maxDisplayedLines="1"/>
                    <s:ToggleButton label="start sharing of own screen." id="publishButton" click="publishButton_clickHandler(event)"/>
               </s:HGroup>
               <!---
               Here Subscriber will be placed
               -->
          </s:VGroup>
     </rtc:ConnectSessionContainer>
     <s:Rect width="100%" height="100%" includeIn="login">
          <s:fill>
               <s:SolidColor color="#FFFFFF"/>
          </s:fill>
     </s:Rect>
     <s:VGroup width="100%" height="100%" verticalAlign="middle" horizontalAlign="center" includeIn="login">
          <s:Label text="Loading..."/>
     </s:VGroup>
</s:Application>

While running this i am creating two instances of this application in two browser windows. And publisher window can't display own stream while other window showing stream correclty.

And another question -- i've tried to start two ScreenSharing streams on the same computer(this this app, by launching it in two browser windows), but second stopped with error. Only one stream allowed or you will provide such support? I think, would be nice to have a chance to configure stream on the fly -- add and remove sharing applications and windows while streaming.

Avatar

Correct answer by
Former Community Member

Sorry, that's a lot for us to debug here - I do know for sure that there's

nothing that prevents a simple app with a pub and sub from working. I'm

guessing there's something wrong with the combobox code.

You're right that you can only screenshare once at a time per computer.

This is a limitation we don't really have much control over - only one addin

can successfully launch at once.

thanks

nigel

Avatar

Level 2

Hi!

I've cuted code to very simple application that uses flashvars to determine will it publish stream or just subscribe:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                  xmlns:s="library://ns.adobe.com/flex/spark"
                  xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" xmlns:rtc="http://ns.adobe.com/rtc" xmlns:collaboration="com.adobe.rtc.collaboration.*">
     <fx:Script>
          <![CDATA[
               import com.adobe.rtc.events.SessionEvent;
               protected function session_synchronizationChangeHandler(event:SessionEvent):void{
                    if(!this.session.isSynchronized) return;
                    if(this.parameters.publisher){
                         this.publisher.publish();
                    }
                    this.subscriber.subscribe();
               }
          ]]>
     </fx:Script>
     <fx:Declarations>
          <rtc:AdobeHSAuthenticator id="auth" userName="******" password="*****"/>
     </fx:Declarations>
     <rtc:ConnectSessionContainer id="session" roomURL="https://collaboration.adobelivecycle.com/******" authenticator="{this.auth}" width="100%" height="100%" synchronizationChange="session_synchronizationChangeHandler(event)">
          <rtc:ScreenSharePublisher id="publisher" playerVersion="10"/>
          <rtc:ScreenShareSubscriber id="subscriber" width="100%" height="100%"/>
     </rtc:ConnectSessionContainer>
</s:Application>

At first I am launching publisher application with flashvars "publisher=1" and it starts to publish. Then I am launching second application with empty flashvars and it starts to listen my streams.

Expected results:

Both applications showing default share screen stream.

Actual result:

Only subscriber application will show stream, publisher application will show black screen, but both subscribed to the same stream.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----