{"id":4584,"date":"2021-11-29T20:42:45","date_gmt":"2021-11-29T12:42:45","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4584"},"modified":"2022-04-08T19:29:05","modified_gmt":"2022-04-08T11:29:05","slug":"handle-application-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/react-native-toolkit\/handle-application-switch\/","title":{"rendered":"Handle Application Switch: React Native SDK &#8211; Video API"},"content":{"rendered":"\n<p>User may switch to different application pushing your RTC Application to Background and vice versa. You need to handle such activity using <code>Enx.onPause()<\/code> and <code>Enx.onResume()<\/code> methods. <\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>Enx.onPause(localMuteState, remoteMuteState)<\/code> <\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>localMuteState<\/code> &#8211; Boolean. Pass <em>false<\/em> to pause local Video Stream, <em>true<\/em> to continue with publishing<\/li><li><code>remoteMuteState<\/code> &#8211; Boolean. Pass <em>false<\/em> to pause receiving remote Video Stream, <em>true<\/em> to continue receiving<br> <\/li><\/ul>\n\n\n\n<p><strong>Method: <\/strong><code>Enx.onResume(localUnmuteState, remoteUnmuteState)<\/code><\/p>\n\n\n\n<ul><li><code>localUnmuteState<\/code> &#8211; Boolean. Pass true to resume sending local Video Stream if it was stopped while getting to Background. <\/li><li><code>remoteUnmuteState<\/code> &#8211; Boolean. Pass true to resume receiving remote Video Streams if they stopped while getting to Background.  <br><br> <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ When application goes to Background \nthis.setState({localMuteState : false});\nthis.setState({remoteMuteState : false}); \nEnx.onPause( localMuteState, remoteMuteState );   \n\n\/\/ When application comes back to Foreground \nthis.setState({localUnmuteState : true});\nthis.setState({remoteUnmuteState : true});  \nEnx.onResume( localUnmuteState, remoteUnmuteState);  <\/pre>\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=\"..\/audio-only-mode\/\">Audio Only Mode<\/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=\"..\/take-image-snapshot\/\">Take Image Snapshot<\/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>User may switch to different application pushing your RTC Application to Background and vice versa. You need to handle such activity using Enx.onPause() and Enx.onResume() methods. Method: Enx.onPause(localMuteState, remoteMuteState) Parameters: localMuteState &#8211; Boolean. Pass false to pause local Video Stream, true to continue with publishing remoteMuteState &#8211; Boolean. Pass false to pause receiving remote Video Stream, true to continue receiving Method: Enx.onResume(localUnmuteState, remoteUnmuteState) localUnmuteState &#8211; Boolean. Pass true to resume&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3747,"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":"User may switch to different application pushing your RTC Application to Background and vice versa. You need to handle such activity using Enx.onPause() and Enx.onResume() methods. Method: Enx.onPause(localMuteState, remoteMuteState) Parameters: localMuteState &#8211; Boolean. Pass false to pause local Video Stream, true to continue with publishing remoteMuteState &#8211; Boolean. Pass false to pause receiving remote Video&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4584"}],"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=4584"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4584\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3747"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}