The Annotation feature allows you to annotate on a Remote Stream. To support Annotations, you need to enable Canvas Streaming during Room Creation by setting: { canvas: true; }} in the JSON payload. To implement Annotation, you need to add Annotation Toolbar before you can start Annotations.

Table of Contents

Add Annotation Toolbar

After getting start annotation acknowledgment or based on user need, add Annotation toolbar to his view that helps you to use tools to annotate over the video.

Exm - <EnxToolBarView style={{ width: 200, height: 50 }}>

Start Annotation

The Enx.startAnnotation() method is used to start Annotation on a given Stream object.

ClassEnx

Method: Enx.startAnnotation(streamId); 

Parameter: 

streamId – StreamId of the Stream Object to be annotated.

Callbacks:

  • startAnnotationAck – Acknowledgment to the Annotator when Annotation starts.
  • annotationStarted – Notification to everyone in the Room when Annotation starts.

Stop Annotation

The Enx.stopAnnotation() method is used to stop Annotations.

Class: Enx

Method: Enx.stopAnnotation(); – No parameter required

Callbacks:

  • stoppedAnnotationAck – Acknowledgment to the Annotator when Annotation stops.
  • annotationStopped – Notification to everyone in the Room when Annotation stops.
Enx.startAnnotation(streamId); // Start Annotation
Enx.stopAnnotation();  // Stop Annotation


startAnnotationAck:event=>{
        // Acknowlegement to Annotator - Annotation started
              }
annotationStarted:event=>{
         // Notification to all - Annotation started
              }
stoppedAnnotationAck:event=>{
        // Acknowlegement to Annotator - Annotation stopped
              }
annotationStopped:event=>{
        // Notification to all - Annotation stopped
              }

Error Codes / Exceptions: 

CodeDescription
5093Annotation Access denied.
5104Repeated startAnnotation() call made while Annotations already active in the Room.
5106Repeated startAnnotation() call made while a previous request is in process.
5108Invalid Stream passed to startAnnotation().
5109Failed to publish Annotation Stream.
5112Annotation support available in Landscape Mode only.
5094Repeated stopAnnotation() call made while a previous request is in process.