A uiview with my video

Hi. In my previous questions you helped me a lot! Thanks! Now i have fully custom UIView in meeting. But i have another one simple question. I read forum a lot, but unfortunately I couldn’t find answer. how can I show the user himself? (small view in top right corner). Here is code how i show custom uiview

Hey @hortondima

I am super happy to hear :slight_smile: It is good to see you again!

Your code looks good except that you are using a MobileRTCActiveVideoView. The ActiveVideoView is the video view that would be the current “active” speaker in the meeting. For example, this would be the user who gets put into the front of your meeting when you are using the Zoom app. To render your own camera, try using a MobileRTCVideoView instead.

Then you should also be able to use MobileRTC.shared().getMeetingService()?.myselfUserID() when passing the userID in, so that you do not have to hardcode the ID.

Something similar to this:

if let localUserID = MobileRTC.shared().getMeetingService()?.myselfUserID() {
let videoView = MobileRTCVideoView(frame: self.view.bounds)
videoView.showAttendeeVideo(withUserID: localUserID)
view.addSubview(videoView)
}

The code above is not constrained to the corner but should render the users video.

Let me know if that works!
Thanks!
Michael

1 Like
  1. Preview, it works, but it dissapear about few seconds(it’s logical))
  2. VideoView (which i need) doesn’t work and i have no idea why.
  3. Active. It works too, but i don’t need it either

withUserId i will pass in future, it isn’t a problem. the problem is in VideoView and how to show user in front camera. i hope you’ll help. thanks a lot for all your answers

Hey @hortondima

I see! Thank you for providing the screenshots, these are very helpful.

Sometimes a race condition can exist between showing your custom meeting ui, joining a meeting, and rendering the stream. If showAttendeeVideo is called before the Zoom backend has recognized the joining of the meeting, or if showAttendeeVideo is called before the custom meeting ui is fully loaded, the view will not render properly.

onInitMeetingView is called before the current user has actually entered the meeting. Try and call your code from within onMeetingError to test if this is the case.

Lemme know if anything changes.
Thanks!
Michael

you are the best! thanks a lot!

1 Like

@hortondima

Awesome! I am so glad to hear it is working!

Let us know if you have any other questions.

Thanks!
Michael

1 Like