Availability: iOS SDK v1.5.6+
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
Initiate Annotation Toolbar using the following code in XML:
EnxToolBar *toolBar = [[EnxToolBar alloc] initWithFrame:CGRectMake(X, Y, width, height)];
Start Annotation
The EnxRoom.startAnnotation()
is used to start Annotation on a given Stream object.
Class: EnxRoom
Method:
-(void)startAnnotation:(EnxStream *_Nonnull)stream
Parameter:
EnxStream
– Stream Object to be annotated.
Delegate Methods:
-room:didStartAnnotationACK:(NSArray *_Nullable)Data
– Acknowledgment to the Annotator when Annotation starts.-room:didAnnotationStarted:(NSArray *_Nullable)Data
– Notification to everyone in the Room when Annotation starts.
// Start Annotation -(void)startAnnotation:(EnxStream*_Nonnull)stream; // Stop Annotation -(void)stopAnnotation; // Notification to all - Annotation started -(void)room: (EnxRoom *_Nullable) room didAnnotationStarted: (NSArray *_Nullable) Data; // Acknowlegement to Annotator - Annotation started -(void)room: (EnxRoom *_Nullable) room didStartAnnotationACK: (NSArray *_Nullable) Data; // Notification to all - Annotation stopped -(void)room: (EnxRoom *_Nullable) room didAnnotationStopped: (NSArray *_Nullable) Data; // Acknowlegement to Annotator - Annotation stopped -(void)room: (EnxRoom *_Nullable) room didStoppedAnnotationACK: (NSArray *_Nullable) Data;
Stop Annotation
The EnxRoom.stopAnnotation()
method is used to stop Annotations.
Method:
-(void)stopAnnotation
Delegate Methods:
-room:didStoppedAnnotationACK:(NSArray *_Nullable)Data
– Acknowledgment to the Annotator when Annotation stops.-room:didAnnotationStopped:(NSArray *_Nullable)Data
– Notification to everyone in the Room when Annotation stops.
Error Codes / Exceptions:
Code | Description |
---|---|
5093 | Annotation Access denied. |
5104 | Repeated startAnnotation() call made while Annotations already active in the Room. |
5106 | Repeated startAnnotation() call made while a previous request is in process. |
5108 | Invalid Stream passed to startAnnotation() . |
5109 | Failed to publish Annotation Stream. |
5112 | Annotation support available in Landscape Mode only. |
5094 | Repeated stopAnnotation() call made while a previous request is in process. |