{"id":4232,"date":"2021-11-12T15:05:32","date_gmt":"2021-11-12T07:05:32","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4232"},"modified":"2022-04-11T13:12:55","modified_gmt":"2022-04-11T05:12:55","slug":"annotation","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/annotation\/","title":{"rendered":"Annotation: Android SDK &#8211; Video API"},"content":{"rendered":"\n<p><strong>Availability<\/strong>: <em>Android SDK v1.5.6+<\/em><\/p>\n\n\n\n<p>The Annotation feature allows you to annotate on a Remote Stream. To support Annotations, you need to enable Canvas Streaming during <a rel=\"noreferrer noopener\" href=\"https:\/\/www.enablex.io\/developer\/video-api\/server-api\/rooms-route\/#create-room\" target=\"_blank\">Room Creation<\/a> by setting: { canvas: true; }} in the JSON payload. To implement Annotation, you need to add Annotation Toolbar before you can start Annotations. <\/p>\n\n\n\n<h4>Table of Contents<\/h4>\n\n\n\n<ul><li><a href=\"#annotation-toolbar\">Add Annotation Toolbar<\/a><\/li><li><a href=\"#annotation-start-stop\">Start \/ Stop Annotation<\/a><\/li><\/ul>\n\n\n\n<a name=\"annotation-toolbar\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Add Annotation Toolbar<\/h3>\n\n\n\n<p>Initiate Annotation Toolbar using the following code in XML:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;enx_rtc_android.annotations.EnxAnnotationsToolbar\n        android:id=\"@+id\/annotations_bar\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\/&gt;<\/pre>\n\n\n\n<a name=\"annotation-start-stop\"><\/a>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Start Annotation<\/h3>\n\n\n\n<p>The <code>EnxRoom.startAnnotation()<\/code> method is used to start Annotation on a given Stream object. To initiate Annotation, you need to&nbsp;<code>setAnnotationObserver<\/code>&nbsp;after getting connected to the room.<\/p>\n\n\n\n<p><strong>Class<\/strong>:&nbsp;<code>EnxRoom<\/code><\/p>\n\n\n\n<p><strong>Observer<\/strong>:&nbsp;<code>public void setAnnotationObserver(Annotations-Observer-Instance)<\/code><\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>public void startAnnotation(EnxStream)<\/code>&nbsp;<\/p>\n\n\n\n<p><strong>Parameter:<\/strong>&nbsp;<\/p>\n\n\n\n<p><code>EnxStream<\/code> &#8211; Stream Object to be annotated.<\/p>\n\n\n\n<p><strong>Callbacks<\/strong>:<\/p>\n\n\n\n<ul><li><code>public void&nbsp;onStartAnnotationAck(JSONObject)<\/code>&nbsp;\u2013 Acknowledgment to the Annotator when Annotation starts.<\/li><li><code>public void&nbsp;onAnnotationStarted(EnxStream)<\/code>&nbsp;\u2013 Notification to everyone in the Room when Annotation starts.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Set Observer\nroom.setAnnotationObserver(Annotations-Observer-Instance);\n\n\/\/ Start Annotation\nroom.startAnnotation(EnxStream enxStream); \n\n\/\/ Notification to all - Annotation started\npublic void onAnnotationStarted(EnxStream enxStream) {\n\t\/\/ Add Annotations view to parent view\n\t((ViewGroup) mAnnotationViewContainer).addView(enxStream.EnxPlayerView);\n\n}\n \n\/\/ Acknowlegement to Annotator - Annotation started\npublic void onStartAnnotationAck(JSONobject jsonObject) {\n\t\/\/ Handdle UI. See info on jsonObject\n}<\/pre>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Stop Annotation<\/h3>\n\n\n\n<p>The <code>EnxRoom.stopAnnotation()<\/code> method is used to stop Annotations.<\/p>\n\n\n\n<p><strong>Class:<\/strong> EnxRoom<\/p>\n\n\n\n<p><strong>Method:<\/strong> <code>public void stopAnnotation()<\/code> <\/p>\n\n\n\n<p><strong>Callbacks:<\/strong><\/p>\n\n\n\n<ul id=\"block-d08e6f85-2223-44d1-8ab0-dc69d2d10cf4\"><li><code>public void&nbsp;onStoppedAnnotationAck(JSONObject)<\/code>&nbsp;\u2013 Acknowledgment to the Annotator when Annotation stops.<\/li><li><code>public void&nbsp;onAnnotationStopped(EnxStream)<\/code>&nbsp;\u2013 Notification to everyone in the Room when Annotation stops.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Stop Annotation\nroom.stopAnnotation(); \n\n\/\/ Notification to all - Annotation stopped\npublic void onAnnotationStopped(EnxStream enxStream) {\n\/\/ Remove Annotations view to parent view\n((ViewGroup) mAnnotationViewContainer).removeView(enxStream.EnxPlayerView);\n\n}\n\n\/\/ Acknowlegement to Annotator - Annotation stopped\npublic void onStoppedAnnotationAck(JSONobject jsonObject) {\n\/\/ Handdle UI. See info on jsonObject\n}<\/pre>\n\n\n\n<p><strong><strong>Error Codes \/ Exceptions<\/strong>:<\/strong>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Code<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>5093<\/td><td>Annotation Access denied.<\/td><\/tr><tr><td>5104<\/td><td>Repeated <code>startAnnotation()<\/code> call made while Annotations already active in the Room.<\/td><\/tr><tr><td>5106<\/td><td>Repeated <code>startAnnotation()<\/code> call made while a previous request is in process.<\/td><\/tr><tr><td>5108<\/td><td>Invalid Stream passed to <code>startAnnotation()<\/code>.<\/td><\/tr><tr><td>5109<\/td><td>Failed to publish Annotation Stream.<\/td><\/tr><tr><td>5112<\/td><td>Annotation support available in Landscape Mode only.<\/td><\/tr><tr><td>5094<\/td><td>Repeated <code>stopAnnotation()<\/code> call made while a previous request is in process.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>\u2190 <a href=\"..\/canvas-streaming\/\"><\/a><a href=\"..\/canvas-streaming\/\">Canvas Streaming<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-center\"><a href=\"..\/\">Index<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<p class=\"has-text-align-right\"><a href=\"..\/recording\/\"><\/a><a href=\"..\/recording\/\">Record Session<\/a> \u2192<a href=\"\/developer\/how-to-use\/\"><\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Availability: Android 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 Start \/ Stop Annotation Add Annotation Toolbar Initiate Annotation Toolbar using the following&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3740,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ub_ctt_via":""},"featured_image_src":null,"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"featured":false,"featured-large":false},"uagb_author_info":{"display_name":"vcxdevwpadmin","author_link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/author\/vcxdevwpadmin\/"},"uagb_comment_info":0,"uagb_excerpt":"Availability: Android 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&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4232"}],"collection":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/comments?post=4232"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4232\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3740"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}