Avaya Client SDK

< Back to Package Overview

Adding support for Web Collaboration

The collaboration service API provide collaboration functionality to the client application. Further, it takes care of retrieving data from the server, managing and performing business logic on this data and finally presenting it to the UI layer. This API attempts to use closures where possible.

It provides core collaboration functions for clients served by Collaboration server:

  • receive new collaborations
  • display the shared information from other participants
  • allows getting the Capabilities
  • allows to share (screen, whiteboard ...)
  • allows send/receive the chat messages

Initialization and Configuration

The CollaborationService object is obtained from the Client SDK's User object. The UserConfiguration object will be used to define the services that will be available to end users of your application. Each service is configured individually; its configuration is stored in a dedicated object, referenced from the UserConfiguration object.

Note: More information on service configuration can be found in the article configuring the SDK.

Start by obtaining any existing service configuration and enable the service:

userConfiguration.WcsConfiguration.Enabled = true;

After you instantiate and set up any required configuration objects, you are now ready to create the User and then call the CreateUser () method of your ClientInstance to start all services. Then you can get the CollaborationService for its further usage:

CollaborationService CollaborationServiceInstance = user.CollaborationService;

Receive new collaborations To receive new collaborations you should register to Web Collaboration Service Events from the instance to collaboration service.

CollaborationServiceInstance.CollaborationCreated += CollaborationCreated;
CollaborationServiceInstance.CollaborationCreationFailed += 
CollaborationCreationFailed;
CollaborationServiceInstance.CollaborationRemoved += CollaborationRemoved;

Messages about new collaboration will come in delegate: CollaborationCreated In this point you will have instance of new collaboration.

Display the shared information from other participants

To be able to receive and display the sharing stream from the collaboration server you should do the following:

1) CollaborationCreated delegate should store collaboration instance and register to Collaboration Events

Collaboration CollaborationInstance = e.Collaboration;
collaboration.Started += collaborationStarted;
collaboration.Ended += collaborationEnded;

2) collaborationStarted delegate should store the Content Sharing Instance and register to Content Sharing Events

ContentSharing  ContentSharingInstance = CollaborationInstance.ContentSharing
ContentSharingInstance.Started += ContentSharingStarted;
ContentSharingInstance.Ended += ContentSharingEnded;
ContentSharingInstance.SharingFrameReceived += ContentSharingFrameReceived;
ContentSharingInstance.SharingFrameChanged += ContentSharingFrameChanged;

3) ContentSharingStarted delegate should create and show new Window. This window should contain ScrollViewer with "csdk:ContentSharingCanvas" from the public API:



        
            
        


The ContentSharingInstance should be set in ContentSharingCanvas, for example in constructor of the Window class

SharingCanvas.SetContentSharing(contentSharing);

High DPI display awareness

If you are planning to run web collaboration on high DPI display, you should keep in mind that there are two different DPI awareness modes in Windows. By default Windows assumes it is high DPI non-aware application and scales GDI objects and bitmaps. ClientSDK uses GDI for screen capturing, therefore collaboration in that case can be displayed incorrectly.

To turn off default scaling logic on high DPI displays, application should specify own DPI awareness through an application manifest setting or programmatically through an API call. You can find enablig DPI aware through an application manifest below.


 ...
  
      
        true/pm
      
 ...