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<void> stopVideoTracksOnApplicationBackground(bool videoMuteLocalStream, bool videoMuteRemoteStream)
Parameters:
@param bool videoMuteLocalStream
– Boolean. Pass false to pause local Video Stream, true to continue with publishing@param bool videoMuteRemoteStream
– Boolean. Pass false to pause receiving remote Video Stream, true to continue receiving
Method: static Future<void> startVideoTracksOnApplicationForeground( bool restoreVideoRemoteStream, bool restoreVideoLocalStream)
Parameters:
@param bool restoreVideoLocalStream
– Boolean. Pass true to resume sending local Video Stream if it was stopped while getting to Background.@param bool restoreVideoRemoteStream
– Boolean. Pass true to resume receiving remote Video Streams if they stopped while getting to Background.
// When application goes to Background EnxRtc. stopVideoTracksOnApplicationBackground (localMuteState, remoteMuteState); // When application comes back to Foreground EnxRtc.startVideoTracksOnApplicationForeground(remoteUnmuteState, localUnmuteState);