MobileRTCActiveVideoView does not display the video at startup

I am working on an app using custom meeting UI but MobileRTCActiveVideoView does not display the video for the active user at startup, it remains black until another user becomes active (for audio detection).

If the active user at startup has disabled the camera then the user icon placeholder is visible but when the camera is re-enabled then the ActiveVideoView becomes black.

It started happeing after updating the Zoom meeting SDK from v5.4.54802.0124 to v5.7.6.1076, with the old SDK MobileRTCActiveVideoView works as expected.

I did some test with sample app with custom UI and I see a similar issue in bottom video cells. They remain black at startup.

Meeting SDK version 5.7.6.1076

Device: [e.g. iPhone 6s, Iphone 7]
OS: [e.g. iOS 14.8]

Hey @criva,

Thanks for using the dev forum!

Where are you setting up the activeVideoView?

Thanks!
Michael

The app instantiates a CustomMeetingViewController inside the onInitMeetingView of the MobileRTCCustomizedUIMeetingDelegate

extension SDKStartJoinMeetingPresenter: MobileRTCCustomizedUIMeetingDelegate {
    func onInitMeetingView() {
        self.customMeetingVC = CustomMeetingViewController()
        if let rootVC = self.rootVC, let customMeetingVC = self.customMeetingVC {
            rootVC.addChild(customMeetingVC)
            rootVC.view.addSubview(customMeetingVC.view)
            customMeetingVC.didMove(toParent: rootVC)
            customMeetingVC.view.frame = rootVC.view.bounds
        }
    }
}

The CustomMeetingViewController contains an VideoPageViewController: UIPageViewController

CustomMeetingViewController: UIViewController {

    lazy var baseView: UIView = {
        let _baseView = UIView(frame:self.view.bounds)
        _baseView.autoresizingMask =  [.flexibleWidth, .flexibleHeight]
        return _baseView
    }()
    lazy var videoPageVC: VideoPageViewController = {
        let _videoPageVC = VideoPageViewController()
        _videoPageVC.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        return _videoPageVC
    }()
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(self.baseView)
        self.addChild(self.videoPageVC)
        self.baseView.addSubview(self.videoPageVC.view)
    }
}

and the first page (FirstPageViewController) contains the MobileRTCActiveVideoView.

FirstPageViewController: UIViewController { 
    lazy var activeVideoView: MobileRTCActiveVideoView = {
        let _activeVideoView = MobileRTCActiveVideoView.init(frame: self.view.bounds)
        _activeVideoView.setVideoAspect(MobileRTCVideoAspect_Original)
        return _activeVideoView
    }()

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(self.activeVideoView)
    }
  }

@Michael_Condon

As a temporary workaround I added the following code in viewDidLoad

        let delayTime = DispatchTime.now() + 3.0
        DispatchQueue.main.asyncAfter(deadline: delayTime, execute: {
            if let activeUserId = MobileRTC.shared().getMeetingService()?.activeUserID() {
                self.activeVideoView.stopAttendeeVideo()
                self.activeVideoView.showAttendeeVideo(withUserID: activeUserId)
            }
        })

but it is too dirty for the release version.

I hope that you can help me to find a better solution.

Hey @criva,

Can you try moving the code that is inside of your DispatchQueue block into the callback: onSinkMeetingActiveVideo?

Thanks!
Michael

@Michael_Condon

I’ve tried to move my code inside the onSinkMeetingActiveVideo callback and It fixes the issue but the onSinkMeetingActiveVideo fires multiple times during the meeting startup.

Do you think that call multiple times stopAttendeeVideo and showAttendeeVideo is a good idea?

Hey @criva,

The active video view is supposed to automatically handle showing/hiding the active user. I do not think you need to call these methods but rather set up the active video view inside that callback.

Thanks!
Michael

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.