{"id":4812,"date":"2021-12-08T19:22:38","date_gmt":"2021-12-08T11:22:38","guid":{"rendered":"https:\/\/www.enablex.io\/developer\/?page_id=4812"},"modified":"2022-04-08T19:48:35","modified_gmt":"2022-04-08T11:48:35","slug":"handle-application-switch","status":"publish","type":"page","link":"https:\/\/doc.smartflomeet.ttns.in\/developer\/video-api\/client-api\/cordova-toolkit\/handle-application-switch\/","title":{"rendered":"Handle Application Switch: Cordova\/Ionic 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 the following methods: <\/p>\n\n\n\n<p><strong>Method:<\/strong> <\/p>\n\n\n\n<p><code>stopVideoTracksOnApplicationBackground( localMuteState, remoteMuteState , successCallback, errorCallback )<\/code><\/p>\n\n\n\n<p> <strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>@param {boolean} localMuteState<\/code> \u2013 Boolean. Pass&nbsp;<em>true<\/em>&nbsp;to pause local Video Stream,&nbsp;<em>false<\/em>&nbsp;to continue with publishing<\/li><li><code>@param {boolean} remoteMuteState<\/code> \u2013 Boolean. Pass&nbsp;<em>true<\/em>&nbsp;to pause receiving remote Video Stream,&nbsp;<em>false<\/em>&nbsp;to continue receiving<\/li><li><code>@param {CallableFunction} successCallback<\/code><\/li><li><code>@param {CallableFunction} errorCallback <\/code><\/li><\/ul>\n\n\n\n<p><strong>Method: <\/strong><\/p>\n\n\n\n<p><code>startVideoTracksOnApplicationForeground( localUnMuteState, remoteUnMuteState , successCallback, errorCallback )<\/code><\/p>\n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<ul><li><code>@param {boolean} localUnMuteState<\/code> \u2013 Boolean. Pass true to resume sending local Video Stream if it was stopped while getting to Background.<\/li><li><code>@param {boolean} remoteUnmuteState<\/code> \u2013 Boolean. Pass true to resume receiving remote Video Streams if they stopped while getting to Background. <\/li><li><code>@param {CallableFunction} successCallback<\/code><\/li><li><code>@param {CallableFunction} errorCallback<\/code><\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ To pause\nwindow.EnxRtc.stopVideoTracksOnApplicationBackground(true,true,function\n(data) {\nconsole.log('Excelsior success! ' + JSON.stringify(data.data));\n}, function (err) {\nconsole.log('Uh oh\u2026 error' + JSON.stringify(err));\n});\n\n\/\/ To Resume\nwindow.EnxRtc.startVideoTracksOnApplicationForeground\n(true,true,,function (data) {\nconsole.log('Excelsior success! ' + JSON.stringify(data.data));\n}, function (err) {\nconsole.log('Uh oh\u2026 error' + JSON.stringify(err));\n});<\/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=\"..\/enable-proximity-sensor\/\"><\/a><a href=\"..\/enable-proximity-sensor\/\">Enable Proximity Sensor<\/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 the following methods: Method: stopVideoTracksOnApplicationBackground( localMuteState, remoteMuteState , successCallback, errorCallback ) Parameters: @param {boolean} localMuteState \u2013 Boolean. Pass&nbsp;true&nbsp;to pause local Video Stream,&nbsp;false&nbsp;to continue with publishing @param {boolean} remoteMuteState \u2013 Boolean. Pass&nbsp;true&nbsp;to pause receiving remote Video Stream,&nbsp;false&nbsp;to continue receiving @param {CallableFunction} successCallback @param {CallableFunction} errorCallback Method: startVideoTracksOnApplicationForeground( localUnMuteState, remoteUnMuteState&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":3719,"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 the following methods: Method: stopVideoTracksOnApplicationBackground( localMuteState, remoteMuteState , successCallback, errorCallback ) Parameters: @param {boolean} localMuteState \u2013 Boolean. Pass&nbsp;true&nbsp;to pause local Video Stream,&nbsp;false&nbsp;to continue with publishing @param {boolean} remoteMuteState \u2013 Boolean. Pass&nbsp;true&nbsp;to pause receiving&hellip;","_links":{"self":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4812"}],"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=4812"}],"version-history":[{"count":0,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/4812\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/pages\/3719"}],"wp:attachment":[{"href":"https:\/\/doc.smartflomeet.ttns.in\/developer\/wp-json\/wp\/v2\/media?parent=4812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}