iOS : Zoom custom UI cannot able to see the screen shared by the host

Hey @vignesh,

Unfortunately, I was unable to reproduce this issue. I am curious if the sizing is causing issues. Is it possible that the view that you are using to render the share content is underneath another view, sized incorrectly, or not properly added to the view hierarchy? I have made this mistake in the past. To troubleshoot, I created a container view with a hardcoded size and a red background (just to make sure I could see where the view is supposed to be on the screen), then I added the share view inside the container view.

Here is some sample code that I used. This code renders the local user’s video in the corner, the active meeting video in the background of the view, and when someone begins to share, a new view is added that renders the share view on top of the active meeting video.

import UIKit
import MobileRTC

class CustomMeetingUIViewController: UIViewController {
    // These are just some container views that have storyboard contraints
    @IBOutlet weak var userCameraView: UIView!
    @IBOutlet weak var meetingView: UIView!

    // A button to leave the meeting
    @IBAction func leaveButtonPressed(_ sender: UIButton) {
        MobileRTC.shared().getMeetingService()?.leaveMeeting(with: LeaveMeetingCmd_Leave)

        let rootViewController = self.navigationController?.viewControllers.first as? ViewController
        MobileRTC.shared().getMeetingService()?.delegate = rootViewController
        navigationController?.popToRootViewController(animated: true)
    }

    override func viewDidLoad() {
        self.navigationItem.setHidesBackButton(true, animated: true)
    }

    override func viewDidAppear(_ animated: Bool) {
        if let firstUserWhoIsntLocalUser = MobileRTC.shared().getMeetingService()?.activeUserID() {
            let activeMeetingView = MobileRTCActiveVideoView(frame: meetingView.bounds)
            activeMeetingView.setVideoAspect(MobileRTCVideoAspect_PanAndScan)
            meetingView.addSubview(activeMeetingView)
            activeMeetingView.showAttendeeVideo(withUserID: firstUserWhoIsntLocalUser)
        }

        if let userID = MobileRTC.shared().getMeetingService()?.myselfUserID() {
            let usersVideoView = MobileRTCVideoView(frame: userCameraView.bounds)
            usersVideoView.setVideoAspect(MobileRTCVideoAspect_PanAndScan)
            userCameraView.addSubview(usersVideoView)
            usersVideoView.showAttendeeVideo(withUserID: userID)
        }
    }
}

// MARK: - MobileRTCMeetingServiceDelegate

// Conform CustomMeetingUIViewController to MobileRTCMeetingServiceDelegate.
// MobileRTCMeetingServiceDelegate listens to updates about meetings, such as meeting state changes, join attempt status, meeting errors, etc.
extension CustomMeetingUIViewController: MobileRTCMeetingServiceDelegate {

    // Is called upon in-meeting errors, join meeting errors, start meeting errors, meeting connection errors, etc.
    func onMeetingError(_ error: MobileRTCMeetError, message: String?) {
        switch error {
        case MobileRTCMeetError_PasswordError:
            print("Could not join or start meeting because the meeting password was incorrect.")
        default:
            print("Could not join or start meeting with MobileRTCMeetError: \(error) \(message ?? "")")
        }
    }

    // Is called when the user joins a meeting.
    func onJoinMeetingConfirmed() {
        print("Join meeting confirmed.")
    }

    // Is called upon meeting state changes.
    func onMeetingStateChange(_ state: MobileRTCMeetingState) {
        print("Meeting state changed")
    }
}

extension CustomMeetingUIViewController: MobileRTCShareServiceDelegate {

    func onAppShareSplash() {
        return
    }

    func onSinkMeetingActiveShare(_ userID: UInt) {
        // Add users share stream to a view, then add the view to in a container view.
        // Note, I used activeShareUserID here, but userID would also work.
        if let activeShareUser = MobileRTC.shared().getMeetingService()?.activeShareUserID() {
            let activeMeetingView = MobileRTCActiveShareView(frame: meetingView.bounds)
            activeMeetingView.setVideoAspect(MobileRTCVideoAspect_PanAndScan)
            meetingView.addSubview(activeMeetingView)
            activeMeetingView.showActiveShare(withUserID: activeShareUser)
        }
    }

    func onSinkMeetingShareReceiving(_ userID: UInt) {
        return
    }

    func onSinkShareSizeChange(_ userID: UInt) {
        return
    }
}

Thanks!
Michael