Hey @zacob,
My storyboard is a little complicated because it has lots of buttons and other views, but I basically have 2 UIViews that have a hardcoded size. One view is for rendering the local user’s view, and one is for rendering the remote user’s view.
static func localUserVideoView(_ videoAspect: MobileRTCVideoAspect, frame: CGRect) -> MobileRTCVideoView? {
guard let meetingService = MobileRTC.shared().getMeetingService() else { return nil }
let localUserID = meetingService.activeUserID()
let localUserVideoView = MobileRTCVideoView(frame: frame)
localUserVideoView.setVideoAspect(videoAspect)
let showAttendeeVideoSuccessful = localUserVideoView.showAttendeeVideo(withUserID: localUserID)
if showAttendeeVideoSuccessful {
print("Started showing local user video.")
} else {
print("Failed to show local user video.")
}
return localUserVideoView
}
static func remoteUserVideoView(userID: UInt, videoAspect: MobileRTCVideoAspect, frame: CGRect) -> MobileRTCVideoView? {
let remoteUserVideoView = MobileRTCVideoView(frame: frame)
remoteUserVideoView.setVideoAspect(videoAspect)
let showAttendeeVideoSuccessful = remoteUserVideoView.showAttendeeVideo(withUserID: userID)
if showAttendeeVideoSuccessful {
print("Started showing remote user video.")
} else {
print("Failed to show remote user video.")
}
return remoteUserVideoView
}
Once I run those functions I just add the returned view as a subview to the UIViews in the storyboard.
Thanks!
Michael