Avaya Client SDK

< Back to Package Overview

Annotation During Avaya Co-Browsing Session

Using the SharingServices Package, the Agent can start or stop annotation during active Avaya Co-Browsing session.

To start annotation feature, you must complete the following activities.

  • Register Start Annotation Callbacks
  • Start Annotation

To start annotation using a shape, color and stroke size, you must complete the following activity.

  • Register Set Annotation Callbacks
  • Set Annotation Shape Information

To stop annotation feature, you must complete the following activities.

  • Register Stop Annotation Callbacks
  • Stop Annotation

To clear all agent annotations on the Co-Browse enabled webpage

  • Clear All Agent Annotations

To Hide all customer annotations on the Co-Browse enabled webpage

  • Hide All Customer Annotations

To UnHide all customer annotations on the Co-Browse enabled webpage

  • UnHide All Customer Annotations

To Hide all agent annotations on the Co-Browse enabled webpage

  • Hide All Agent Annotations

To UnHide all agent annotations on the Co-Browse enabled webpage

  • UnHide All Agent Annotations

Register Start Annotation Callbacks

You must register onSuccess and onFailure callbacks. The onSuccess callback is called to report that customer can Annotate on the active Co-Browse enabled webpage. While annotating on the webpage Agent is not allowed to update values for the webpage elements. The onFailure callback is called to report a failure that agent cannot Annotate on the active Co-Browse enabled webpage.

    var onSuccess = function () {
        // Called to report success for start Annotation
        // Add custom GUI code for the agent to use the Annotation feature
        //e.g. Display a toolbar which allows agent to select color, shape or stroke size for annotation on webpage
    };

    var onFailure = function (error) {
        // Called to report failure in 
        // Start Annotation feature
        // Add code here to notify agent
    };  

Start Annotation

Call startAnnotation() method to allow agent to annotate on the Co-Browse enabled webpage.

    _cbinstance.startAnnotation().then(onSuccess.bind(this), onFailure);;

Register Set Annotation Callbacks

You must register onSuccess and onFailure callbacks. The onSuccess callback is called to report that agent can Annotate on the active Co-Browse enabled webpage using the specified annoation shape information obtained from the AnnotationShapeInfo object. The onFailure callback is called to report a failure that agent cannot stop annotation.

    var onSuccess = function () {
        // Called to report success for setting the Annotation object 
    };

    var onFailure = function (error) {
        // Called to report failure for setting the Annotation object 
    };  

Set Annotation Shape Information

Call setAnnotation(AnnotationShapeInfo) method to specify the annotation shape type used for annotating on Co-Browse enabled webpage. The supported annotation shape types and the respective variables are as follows:

  • For Rectangle - AvayaCoBrowseClientServices.Services.Cobrowse.Common.AnnotationShapeType.ANNOTATIONSHAPETYPERECTANGLE
  • For Circle - AvayaCoBrowseClientServices.Services.Cobrowse.Common.AnnotationShapeType.ANNOTATIONSHAPETYPECIRCLE
  • For FreeHand - AvayaCoBrowseClientServices.Services.Cobrowse.Common.AnnotationShapeType.ANNOTATIONSHAPETYPEFREEHAND

The default annotation shape type is FreeHand

    //Create AnnotationInfo object with default values as
    //strokeColor=red, strokeSize=5, annotationShapeType=AvayaCoBrowseClientServices.Services.Cobrowse.Common.AnnotationShapeType.ANNOTATIONSHAPETYPEFREEHAND
    var annotationInfo = new AvayaCoBrowseClientServices.Services.Cobrowse.Common.AnnotationShapeInfo();

    //Create AnnotationInfo object with user specified values 
    //Agent annotates on webpage using Rectangle Shape with strokeColor and strokeSize as 'blue' and '11'

    var annotationInfo= new AvayaCoBrowseClientServices.Services.Cobrowse.Common.AnnotationShapeInfo('blue','11',AvayaCoBrowseClientServices.Services.Cobrowse.Common.AnnotationShapeType.ANNOTATIONSHAPETYPERECTANGLE);

    //Call to setAnnotation method
    _cbinstance.setAnnotation(annotationInfo).then(onSuccess.bind(this), onFailure);    

Register Stop Annotation Callbacks

You must register onSuccess and onFailure callbacks. The onSuccess callback is called to report that agent can no longer annotate on the webpage. The onFailure callback is called to report a failure in stopping annotaion.

    var onSuccess = function () {
        //Called to report success for stop Annotation. 
        //Now agent can update the webpage elements
        //agent is not allowed to annotate on the webpage until an api call is made to start the annotation  
    };

    var onFailure = function (error) {
        // Called to report failure in 
        // Stopping Annotation
        // Add code here to notify agent
    };  

Stop Annotation

Call stopAnnotation() method to disable the annotation mode.

    _cbinstance.stopAnnotation().then(onSuccess.bind(this), onFailure);

Clear All Agent Annotations

Call clearAllAgentAnnotations() method to remove all the agent annotations on the Co-Browse enabled webpage.

    _cbinstance.clearAllAgentAnnotations();

Note - Single click on a specific annotation removes it from the webpage.

Hide All Customer Annotations

Call hideAllCustomerAnnotations() method to hide all customer annotations on the agent webpage.

    _cbinstance.hideAllCustomerAnnotations().then(onSuccess.bind(this), onFailure);

UnHide All Customer Annotations

Call unHideAllCustomerAnnotations() method to unHide customer annotations on the agent webpage.

    _cbinstance.unHideAllCustomerAnnotations().then(onSuccess.bind(this), onFailure);

Hide All Agent Annotations

Call hideAllAgentAnnotations() method to hide all agent annotations on the Co-Browse enabled webpage.

    _cbinstance.hideAllAgentAnnotations().then(onSuccess.bind(this), onFailure);

UnHide All Agent Annotations

Call unHideAllAgentAnnotations() method to unHide agent annotations on the Co-Browse enabled webpage.

    _cbinstance.unHideAllAgentAnnotations().then(onSuccess.bind(this), onFailure);