Mute video when app goes in background

Description
Hello, I am using CustomMeetingUI.
I want to mute the video when the app goes in the background.
I have registered UIApplication.willResignActiveNotification and performed meetingService.muteMyVideo(true) on this event, but the app is crashing after it.

Please let me know if there is anything else to be done.

Which version?
v5.4.54802.0124

Hey @abhishek.nagpure,

Thanks for using the dev forum!

I just did a quick test on the latest version and did not see the same behavior. The video turns into just the user’s name after they have backgrounded the application.
Do you also have
MobileRTC.shared().appWillResignActive()
being called?

Here is my appDelegate code:

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        return true
    }

    func applicationWillTerminate(_ application: UIApplication) {
        MobileRTC.shared().appWillTerminate()
    }

    func applicationDidBecomeActive(_ application: UIApplication) {
        MobileRTC.shared().appDidBecomeActive()
    }

    func applicationWillResignActive(_ application: UIApplication) {
        MobileRTC.shared().getMeetingService()?.muteMyVideo(true)
        MobileRTC.shared().appWillResignActive()
    }

    func applicationDidEnterBackground(_ application: UIApplication) {
        MobileRTC.shared().appDidEnterBackgroud()
    }
}

Thanks!
Michael

1 Like

Hello Michael,
Thank you so much for your prompt reply.

This solution resolved the issue and achieved the expected behavior.

Regards,
Abhishek

1 Like

Hey @abhishek.nagpure,

Awesome! I am really happy to hear! :slight_smile:

Please let us know if you have any other questions.
Michael

Hello Michael,
Yes, I do have one more question. Let me tell you the scenario,

Suppose, if the participant joins the non-started meeting, then the participant is added to the waiting queue.
And later on, when the host starts the meeting, after some seconds he is shown the popup to admit that same participant.

So my question is, can we reduce or configure this time which is taken in between ie. from meeting start to showing admit popup ( for the already waiting participant). And after what time does the ZoomSDK check for the meeting is started or not.

Waiting for your reply, thank you once again.

Hey @abhishek.nagpure,

No, this time is not cofigurable. The prompt will try to be shown as soon as possible.

I do not believe there is a defined time period for this. When the meeting is started a network request is sent to the meeting listeners to inform them the meeting has started.

Thanks!
Michael

Hi Michael, Thank you for the updates.

I have one more question, after updating the SDK to the latest one, the MobileRTCVideoAspect_PanAndScan, is not showing video in full screen.
Some black space is appearing from the top of the videoView.

videoView = MobileRTCActiveVideoView(frame: baseView.bounds)
videoView.setVideoAspect(MobileRTCVideoAspect_PanAndScan)

Hey @abhishek.nagpure,

At what point in your ViewController’s lifecycle are you calling this code?

Thanks!
Michael

Hey Michael_Condon,

I am calling this code in the viewDidLoad().
I also tried calling this in DispatchQueue.main.async {} or in viewDidAppear(), however, it is not showing up on the full screen.

Hey @abhishek.nagpure,

I see, can you run it inside of viewDidAppear. Once the black space starts showing, start the view debugger, and rotate the view debugger so that I can see the layers of the views? If you are not comfortable sharing the UI of your application on this public forum, you can also send it to developersupport@zoom.us with a note that I sent you.

Thanks!
Michael

Hello Michael_Condon,

I followed the mentioned instructions and shared the screenshots on the given email, please check.

Hey @abhishek.nagpure,

Awesome, thank you for sending those over. Will follow up there :slight_smile:

Thanks!
Michael