{"id":3742,"date":"2021-10-01T15:32:33","date_gmt":"2021-10-01T07:32:33","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=3742"},"modified":"2025-04-05T02:55:23","modified_gmt":"2025-04-04T18:55:23","slug":"enxstream","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/android-toolkit\/enxstream\/","title":{"rendered":"EnxStream Class Stream Handler: Android 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 the Portal 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=\"#observers\">Observers<\/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>Private 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>Stream Information<\/strong><\/p>\n\n\n\n<ul><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#get-id\" target=\"_blank\"><code>getId()<\/code><\/a> &#8211; To get Stream ID.<\/li><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#get-attributes\" target=\"_blank\"><code>getAttributes()<\/code><\/a> &#8211; To get all attributes of the Stream.<\/li><li><code><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#get-media\" target=\"_blank\"><code>getMedia()<\/code><\/a><\/code> &#8211; To get Audio and Video tracks.<\/li><li><code><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#stream-state\" target=\"_blank\"><code>getState()<\/code><\/a><\/code> &#8211; To get the current state of the Stream.<\/li><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#track-availability\" target=\"_blank\"><code>hasAudio()<\/code><\/a> &#8211; To know if the Stream has an Audio track.<\/li><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#track-availability\" target=\"_blank\"><code>hasVideo()<\/code><\/a> &#8211; To know if the Stream has a Video track.<\/li><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#track-availability\" target=\"_blank\"><code>hasData()<\/code><\/a> &#8211; To know if the Stream has Text Data.<\/li><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#track-availability\" target=\"_blank\"><code>hasScreen()<\/code><\/a> &#8211; To know if the Stream has Screen Share.<\/li><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#know-local-remote-stream\" target=\"_blank\"><code>ifLocal()<\/code><\/a> &#8211; To know if the Stream is a Local Stream.<\/li><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#active-audio-video\" target=\"_blank\"><code>isAudioActive()<\/code><\/a> &#8211; To know if the Audio Track is currently active.<\/li><li><a rel=\"noreferrer noopener\" href=\"..\/stream-information\/#active-audio-video\" target=\"_blank\"><code>isVideoActive()<\/code><\/a> &#8211; To know if the Video Track is currently active.<\/li><li><a href=\"..\/local-stream\/#init-stream\" target=\"_blank\" rel=\"noreferrer noopener\"><code>getLocalStream()<\/code><\/a> &#8211; To initialize a local stream at the Client endpoint before it can be published to the Room.&nbsp;<\/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><a href=\"..\/mute-audio-video-stream\/#mute-unmute-audio\" target=\"_blank\" rel=\"noreferrer noopener\"><code>muteSelfAudio()<\/code><\/a> &#8211; To mute\/unmute audio of the Local Stream.<\/li><li><a href=\"..\/mute-audio-video-stream\/#mute-unmute-video\" target=\"_blank\" rel=\"noreferrer noopener\"><code>muteSelfVideo()<\/code><\/a> &#8211; To mute\/unmute video of the Local Stream.<\/li><li><a href=\"..\/switch-camera-mic-speaker\/#switch-camera\" target=\"_blank\" rel=\"noreferrer noopener\"><code>switchCamera()<\/code><\/a> &#8211; To switch the Stream source from rear to front Camera or vice-versa.<\/li><li><a href=\"..\/update-stream-configuration\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>updateConfiguration()<\/code><\/a> &#8211; To reconfigure a Stream by adding new or updating existing attributes of the 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>Moderator Controls<\/strong><\/p>\n\n\n\n<ul><li><a href=\"..\/hard-muting\/#hard-mute-unmute-participants\" target=\"_blank\" rel=\"noreferrer noopener\"><code>hardMuteAudio()<\/code><\/a> &#8211; To hard-mute a Participant\u2019s audio.<\/li><li><a href=\"..\/hard-muting\/#hard-mute-unmute-participants\" target=\"_blank\" rel=\"noreferrer noopener\"><code>hardMuteVideo()<\/code><\/a> &#8211; To hard-mute a Participant\u2019s video.<\/li><li><a href=\"..\/hard-muting\/#hard-mute-unmute-participants\" target=\"_blank\" rel=\"noreferrer noopener\"><code>hardUnMuteAudio()<\/code><\/a>&#8211; To lift the audio hard-mute restriction from the Participant.<\/li><li><a href=\"..\/hard-muting\/#hard-mute-unmute-participants\" target=\"_blank\" rel=\"noreferrer noopener\"><code>hardUnmuteVideo()<\/code><\/a> &#8211; To lift the video hard-mute restriction from the Participant.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Play Stream<\/strong><\/p>\n\n\n\n<ul><li><a href=\"\/developer\/video-api\/client-api\/android-toolkit\/play-stream\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>attachRenderer()<\/code><\/a> &#8211; To attach a Stream to the PlayerView.<\/li><li><a href=\"\/developer\/video-api\/client-api\/android-toolkit\/play-stream\/\" target=\"_blank\" rel=\"noreferrer noopener\"><code>detachRenderer()<\/code><\/a> &#8211; To detach a Stream from the PlayerView.<\/li><\/ul>\n\n\n\n<a name=\"observers\"><\/a>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2>Observers &amp; their Callbacks <\/h2>\n\n\n\n<h3>Stream Observer<\/h3>\n\n\n\n<p>Given below is a category-wise listing of Stream Observer Callbacks based on their functions. The Room Observer is initiated along with&nbsp;<a href=\"..\/local-stream\/#init-stream\">Room Initialization Process<\/a>. <\/p>\n\n\n\n<p><strong>Streaming<\/strong><\/p>\n\n\n\n<ul><li><code>onRemoteStreamAudioMute()<\/code> &#8211; Notification to everyone in the Room when a user\u2019s audio is muted.<\/li><li><code>onRemoteStreamAudioUnMute()<\/code> &#8211; Notification to everyone in the Room when a user\u2019s audio is unmuted.<\/li><li><code>onAudioEvent()<\/code> &#8211; Notification to the stream publisher when the Audio track is muted\/unmuted.<\/li><li><code>onVideoEvent()<\/code> &#8211; Notification to the stream publisher when the Video track is muted\/unmuted.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Messaging<\/strong><\/p>\n\n\n\n<ul><li><code>onReceivedData()<\/code> &#8211; When text messages are received.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Hard Mute Audio Observer<\/h3>\n\n\n\n<p><strong>Observer<\/strong>:&nbsp;<code>EnxStream.setMuteAudioStreamObserver(EnxMuteAudioStreamObserver-Object)&nbsp;<\/code>\u2013 To receive the following callbacks: <\/p>\n\n\n\n<ul><li><code>onHardMutedAudio<\/code> &#8211; Acknowledgment to the Moderator when the Participant&#8217;s Audio Stream is hard-muted.<\/li><li><code>onHardUnMutedAudio<\/code> &#8211; Acknowledgment to the Moderator when the hard-mute restriction is lifted from the Participant&#8217;s Audio Stream.<\/li><li><code>onReceivedHardMuteAudio<\/code> &#8211; Notification to the Participant when the Moderator hard-mutes their Audio Stream.<\/li><li><code>onReceivedHardUnMuteAudio<\/code> &#8211; Notification to the Participant when the Moderator lifts the hard-mute restriction from their Audio Stream.<\/li><\/ul>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3>Hard Mute Video Observer<\/h3>\n\n\n\n<p><strong>Observer<\/strong>:&nbsp;<code>EnxStream.setMuteVideoStreamObserver(EnxMuteVideoStreamObserver-Object)<\/code> &#8211; To receive the following callbacks:  <\/p>\n\n\n\n<ul><li><code>onHardMutedVideo<\/code> &#8211; Acknowledgment to the Moderator when the Participant&#8217;s Video Stream is hard-muted.<\/li><li><code>onHardUnMutedVideo<\/code> &#8211; Acknowledgment to the Moderator when the hard-mute restriction is lifted from the Participant&#8217;s Video Stream.<\/li><li><code>onReceivedHardMuteVideo<\/code> &#8211; Notification to the Participant when the Moderator hard-mutes their Video Stream.<\/li><li><code>onReceivedHardUnMuteVideo<\/code> &#8211; Notification to the Participant when the Moderator lifts the hard-mute restriction from their Video Stream.<\/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=\"..\/how-to-use\/\">How to use?<\/a><\/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 the Portal Media Servers. It is also used for receiving Stream endpoints to be played. References: Attributes &#8211; Methods &#8211; Observers Private 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&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3740,"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 the Portal Media Servers. It is also used for receiving Stream endpoints to be played. References: Attributes &#8211; Methods &#8211; Observers Private Attributes id &#8211; Unique Stream ID. local &#8211; Boolean. True for&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3742"}],"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=3742"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3742\/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=3742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}