{"id":3725,"date":"2021-10-01T18:27:58","date_gmt":"2021-10-01T10:27:58","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=3725"},"modified":"2025-02-24T16:36:56","modified_gmt":"2025-02-24T08:36:56","slug":"enxstream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/web-toolkit\/enxstream\/","title":{"rendered":"EnxStream Class Stream Handler: Web SDK \u2013 Video API"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\"><p>The EnxStream is a derived Class from EnxRtc. It handles all the Media Stream-related functions to initiate, configure, and transport Streams to Media Servers. It is also used for receiving Stream endpoints to be played.<\/p><\/blockquote>\n\n\n\n<p> References: <a href=\"#attributes\">Attributes<\/a> &#8211; <a href=\"#methods\">Methods<\/a> &#8211; <a href=\"#events\">Events<\/a><\/p>\n\n\n\n<a name=\"attributes\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Attributes<\/h2>\n\n\n\n<ul><li><code>id<\/code> &#8211; Unique Stream ID.<\/li><li><code>local<\/code> &#8211; Boolean. True for Local Stream, False for Remote Stream.<\/li><li><code>room<\/code> &#8211; JSON Object. Room with which the Stream is associated.<\/li><li><code>showing<\/code> &#8211; Boolean. Whether the stream is being played.<\/li><li><code>audio<\/code> &#8211; Boolean. True if the stream carries Audio Track.<\/li><li><code>video<\/code> &#8211; Boolean. True if the stream carries Video Track.<\/li><li><code>screen<\/code> &#8211; Boolean. True if the stream carries Screen Share.<\/li><li><code>videoSize<\/code> &#8211; Size of Video Frame, defined as [minWidth, minHeight, maxWidth, maxHeight].<\/li><li><code>videoFrameRate<\/code> &#8211; Frame Rate of Video Stream, defined as [min, max].<\/li><li><code>desktopStreamId<\/code> &#8211; Chrome Media Source ID to be used for Screen Share.<\/li><li><code>extensionId<\/code> &#8211; Extension ID to be used for Screen Share.<\/li><li><code>audioMuted<\/code> &#8211; Boolean. True if Audio is muted.<\/li><li><code>videoMuted<\/code> &#8211; Boolean. True if Video is muted.<\/li><li><code>attributes<\/code> &#8211; videoFrameRate.<\/li><\/ul>\n\n\n\n<a name=\"methods\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Methods<\/h2>\n\n\n\n<p>A categorized listing of Stream Handler methods is as given below:<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Basics<\/strong><\/p>\n\n\n\n<ul><li><code><code><code><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/publishing-local-stream\/#close-stream\" target=\"_blank\"><code>close<\/code><\/a><\/code><\/code><\/code><\/code><\/code>()<\/code> &#8211; To close and stop publishing the local Stream.<\/li><li><code><code><a rel=\"noreferrer noopener\" href=\"..\/play-stream\/\" target=\"_blank\"><code>play<\/code><\/a>()<\/code><\/code> &#8211; To play Video on the Player in a given DOM ID.<\/li><li><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/play-stream\/\" target=\"_blank\"><code>stop<\/code><\/a>()<\/code><\/code><\/code> &#8211; To stop playing Video on the Player.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Stream Information<\/strong><\/p>\n\n\n\n<ul><li><code><code><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#get-id\" target=\"_blank\"><code>getId<\/code><\/a>()<\/code><\/code>&#8211; This method provides the ID of the given Stream.<\/li><li><code><code><code><a href=\"..\/stream-information\/#get-attributes\" target=\"_blank\" rel=\"noreferrer noopener\"><code>getAttributes<\/code><\/a>()<\/code><\/code><\/code> &#8211; To get all attributes of the Stream.<\/li><li><code><code><code><code><a href=\"..\/stream-information\/#track-availability\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ifAudio<\/code><\/a><\/code><\/code><\/code>()<\/code> &#8211; To know if the stream has an Audio Track.<\/li><li><code><code><code><code><code><a href=\"..\/stream-information\/#track-availability\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ifVideo<\/code><\/a><\/code><\/code><\/code><\/code>()<\/code> &#8211; To know if the stream has a Video Track.<\/li><li><code><code><code><code><code><a href=\"..\/stream-information\/#track-availability\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ifData<\/code><\/a><\/code><\/code><\/code><\/code>()<\/code> &#8211; To know if the stream has Text Data.<\/li><li><code><code><code><code><code><a href=\"..\/stream-information\/#track-availability\" target=\"_blank\" rel=\"noreferrer noopener\"><code>ifScreen<\/code><\/a><\/code><\/code><\/code><\/code>()<\/code> &#8211; To know if the stream has Screen Share.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Stream Controls<\/strong><\/p>\n\n\n\n<ul><li><code><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#update-stream-attributes\" target=\"_blank\"><code>setAttributes<\/code><\/a>()<\/code><\/code><\/code><\/code> &#8211; To update \/ set attributes of local Stream.<\/li><li><code><code><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#configure-stream\" target=\"_blank\"><code>updateConfiguration<\/code><\/a><\/code><\/code><\/code><\/code>()<\/code> &#8211; To update bandwidth requirement for audio and video for local Stream.<\/li><li><code><code><code><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/mute-audio-video-stream\/#mute-unmute-audio\" target=\"_blank\"><code>muteAudio<\/code><\/a><\/code><\/code><\/code><\/code><\/code>()<\/code> &#8211; To mute audio of local Stream.<\/li><li><code><code><code><code><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/mute-audio-video-stream\/#mute-unmute-video\" target=\"_blank\"><code>muteVideo<\/code><\/a><\/code><\/code><\/code><\/code><\/code><\/code>()<\/code> &#8211; To mute video of local Stream.<\/li><li><code><code><code><code><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/mute-audio-video-stream\/#mute-unmute-audio\" target=\"_blank\"><code>unmuteAudio<\/code><\/a><\/code><\/code><\/code><\/code><\/code><\/code>()<\/code> &#8211; To unmute audio of local Stream.<\/li><li><code><code><code><code><code><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/mute-audio-video-stream\/#mute-unmute-video\" target=\"_blank\"><code>unmuteVideo<\/code><\/a><\/code><\/code><\/code><\/code><\/code><\/code><\/code>()<\/code> &#8211; To unmute video of local Stream.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Miscellaneous<\/strong><\/p>\n\n\n\n<ul><li><code><code><code><code><code><a rel=\"noreferrer noopener\" href=\"..\/take-image-snapshot\/\" target=\"_blank\"><code>getVideoFrameImage<\/code><\/a><\/code><\/code><\/code><\/code>()<\/code> &#8211; To take a Raw Image Snapshot of Stream into Canvas Object.<\/li><li><a href=\"..\/switch-camera-mic-speaker\/#switch-mic\"><code>switchMicrophone()<\/code><\/a> &#8211; To switch Audio source of local Stream to another Microphone connected to the device.<\/li><li><a href=\"..\/switch-camera-mic-speaker\/#switch-camera\"><code>switchCamera()<\/code><\/a> &#8211; To switch Video source of local Stream to another Camera connected to the device.<\/li><\/ul>\n\n\n\n<a name=\"events\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Events<\/h2>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Stream Controls<\/strong><\/p>\n\n\n\n<ul><li><code>media-access-allowed<\/code> &#8211; When access is granted to Camera and Microphone.<\/li><li><code>media-access-denied<\/code> &#8211; When access is denied for Camera and Microphone.<\/li><li><code>stream-attributes-updated<\/code> &#8211; When local Stream attributes are updated.<\/li><\/ul>\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=\"..\/enxroom\/\"><\/a><a href=\"..\/enxroom\/\">EnxRoom \u2013 Room Handler<\/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=\"..\/logger\/\"><\/a><a href=\"..\/logger\/\">Logger \u2013 Log Manager<\/a> \u2192 <\/p>\n<\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The EnxStream is a derived Class from EnxRtc. It handles all the Media Stream-related functions to initiate, configure, and transport Streams to Media Servers. It is also used for receiving Stream endpoints to be played. References: Attributes &#8211; Methods &#8211; Events Attributes id &#8211; Unique Stream ID. local &#8211; Boolean. True for Local Stream, False for Remote Stream. room &#8211; JSON Object. Room with which the Stream is associated. showing&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3724,"menu_order":3,"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":"The EnxStream is a derived Class from EnxRtc. It handles all the Media Stream-related functions to initiate, configure, and transport Streams to Media Servers. It is also used for receiving Stream endpoints to be played. References: Attributes &#8211; Methods &#8211; Events Attributes id &#8211; Unique Stream ID. local &#8211; Boolean. True for Local Stream, False&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3725"}],"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=3725"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3725\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3724"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=3725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}