Start Annotation

Using Annotation API users can annotate on a Remote Stream. You can implement annotations on remote streams using the startAnnotation() method.

Method: startAnnotation( clientId )

Parameters:

@param {String} clientid – The client ID on whose stream the annotations need to be implmented

Event Listeners:

  • onStartAnnotationAck( JSONObject )– Acknowledgement to the Annotator that the Annotation has started.
  • onAnnotationStarted( EnxStream )– Notification to all the participants that the Annotation has started
window.EnxRtc.startAnnotation ( clientId ); // Start Annotaion

// Acknowledgement - Annotation Started
window.EnxRtc.addEventListner("onStartAnnotationAck", function (data) {
	console.log(JSON.stringify(data.data));
});

// Notification to all - Annotation Started
window.EnxRtc.addEventListner("onAnnotationStarted", function (EnxStream) {
	 // Play Annotated Stream
});

Stop Annotation

To stop annotating on the stream, execute the following method. It will stop the ongoing Annotated Stream.

Method: stopAnnotation() – No Parameter is required

Event Listeners:

  • onStoppedAnnotationAck( JSONObject )– Acknowledgement to the Annotator that Annotation has stopped.
  • onAnnotationStopped( EnxStream )– Notification to all the participants that Annotation has stopped.
window.EnxRtc.stopAnnotation (); // Stop Annotaion

// Acknowledgement - Annotatation Stopped
window.EnxRtc.addEventListner("onStoppedAnnotationAck", function (data) {
	console.log(JSON.stringify(data.data));
});

// Notification to all - Annotatation Stopped
window.EnxRtc.addEventListner("onAnnotationStarted", function (enxStream ) {
	 // Annotated Stream
});