{"id":4682,"date":"2021-12-02T21:25:28","date_gmt":"2021-12-02T13:25:28","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4682"},"modified":"2022-04-08T20:24:02","modified_gmt":"2022-04-08T12:24:02","slug":"handle-application-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/flutter-toolkit\/handle-application-switch\/","title":{"rendered":"Handle Application Switch: Flutter 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 following methods: <\/p>\n\n\n\n<p><strong>Method<\/strong>: <code>static Future&lt;void&gt; stopVideoTracksOnApplicationBackground(bool videoMuteLocalStream, bool videoMuteRemoteStream)<\/code><\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>@param bool videoMuteLocalStream<\/code> \u2013 Boolean. Pass&nbsp;<em>false<\/em>&nbsp;to pause local Video Stream,&nbsp;<em>true<\/em>&nbsp;to continue with publishing<\/li><li><code>@param bool videoMuteRemoteStream<\/code> \u2013 Boolean. Pass&nbsp;<em>false<\/em>&nbsp;to pause receiving remote Video Stream,&nbsp;<em>true<\/em>&nbsp;to continue receiving <\/li><\/ul>\n\n\n\n<p><strong>Method<\/strong>: <code>static Future&lt;void&gt; startVideoTracksOnApplicationForeground( bool restoreVideoRemoteStream, bool restoreVideoLocalStream)<\/code><\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>@param bool restoreVideoLocalStream<\/code> \u2013 Boolean. Pass true to resume sending local Video Stream if it was stopped while getting to Background.<\/li><li><code>@param bool restoreVideoRemoteStream<\/code> \u2013 Boolean. Pass true to resume receiving remote Video Streams if they stopped while getting to Background. <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ When application goes to Background \nEnxRtc. stopVideoTracksOnApplicationBackground (localMuteState, remoteMuteState);\n\n\/\/ When application comes back to Foreground \n EnxRtc.startVideoTracksOnApplicationForeground(remoteUnmuteState, localUnmuteState); <\/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\/\"><\/a><a href=\"..\/audio-only-mode\/\">Change to Audio Only Call<\/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=\"..\/set-video-scaling-type\/\">Set Video Scaling Type<\/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 following methods: Method: static Future&lt;void&gt; stopVideoTracksOnApplicationBackground(bool videoMuteLocalStream, bool videoMuteRemoteStream) Parameters: @param bool videoMuteLocalStream \u2013 Boolean. Pass&nbsp;false&nbsp;to pause local Video Stream,&nbsp;true&nbsp;to continue with publishing @param bool videoMuteRemoteStream \u2013 Boolean. Pass&nbsp;false&nbsp;to pause receiving remote Video Stream,&nbsp;true&nbsp;to continue receiving Method: static Future&lt;void&gt; startVideoTracksOnApplicationForeground( bool restoreVideoRemoteStream, bool restoreVideoLocalStream) Parameters: @param bool restoreVideoLocalStream&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3755,"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 following methods: Method: static Future&lt;void&gt; stopVideoTracksOnApplicationBackground(bool videoMuteLocalStream, bool videoMuteRemoteStream) Parameters: @param bool videoMuteLocalStream \u2013 Boolean. Pass&nbsp;false&nbsp;to pause local Video Stream,&nbsp;true&nbsp;to continue with publishing @param bool videoMuteRemoteStream \u2013 Boolean. Pass&nbsp;false&nbsp;to pause receiving remote Video&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4682"}],"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=4682"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4682\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3755"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}