videoView shows its background instead of subscribed users video

We’re having a sporadic issue, where the videoView shows its background instead of the subscribed users’ video. We’ve found increasing the number of users in session increases the possibility of having the issue.

We’ve also found that if a user joins while there are already some users in the session the possibility of experiencing the issue increases. We’ve tried increasing the delay before canvas.subscribe which seems to decrease the possibility of having the issue.

The difficult thing is: canvas.videoStatus()?.on returns true when issue happens and
canvas.subscribe(with: circleView.videoView, andAspectMode: .panAndScan) returns .Errors_Success

## Code Snippet


extension CallView: ZoomVideoSDKDelegate {
    func onUserJoin(_ helper: ZoomVideoSDKUserHelper?, users userArray: [ZoomVideoSDKUser]?) {
        // UserArray contains the new users.
        // Use helper to perform actions on a user.
        if let userArray = userArray {
            self.users.append(contentsOf: userArray)
            for user in userArray {
                DDLogDebug("🧿 onUserJoin user: \(user.stringValue)")
                if let canvas = user.getVideoCanvas(), let username = user.getCustomUserId() {
                    if self.isStream {
                        // Live Stream trip
                        if !self.isBroadcasting && username == self.trip?.username {
                            // host joining
                            DDLogDebug("\tHost joining, subscribing to streamView.videoView")
                            canvas.subscribe(with: self.streamView.videoView, andAspectMode: .panAndScan)
                        }
                        if username != self.trip?.username {
                            // not host, increase audience count
                            self.audienceCount += 1
                        }
                    } else {
                        // Squad trip
                        self.groupView.addUser(user, type: .remote, canvas: canvas)
                    }
                } else {
                    DDLogError("\tCan't get usersVideoCanvas or username")
                }
            }
        }
    }
}

func addUser(_ user: ZoomVideoSDKUser, type: CircleVideoView.StreamType = .remote, canvas: ZoomVideoSDKVideoCanvas) {
    let circleView = CircleVideoView()
    circleView.username = user.getCustomUserId()
    circleView.uid = user.getID()
    circleView.type = type
    circleView.pictureView.isHidden = true
    
    self.videoViews.append(circleView)
    self.videoStack.addArrangedSubview(circleView)
    circleView.snp.makeConstraints { make in
        if let superview = circleView.superview {
            make.height.equalTo(superview.snp.width)
            make.width.equalTo(superview.snp.width)
        }
    }

    circleView.isUserInteractionEnabled = true

    let tap = UITapGestureRecognizer(target: self, action: #selector(self.didTapVideoView(_:)))
    tap.numberOfTapsRequired = 1
    circleView.addGestureRecognizer(tap)

    let swipeLeft = UISwipeGestureRecognizer(target: self, action: #selector(didSwipeLeft))
    swipeLeft.direction = .left
    circleView.videoView.addGestureRecognizer(swipeLeft)
    
    // Subscribe User's videoCanvas to render their video stream.
    DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
        canvas.subscribe(with: circleView.videoView, andAspectMode: .panAndScan)
    }
}

We’re on Zoom Video SDK, iOS v1.0

Any tips/advice appreciated

1 Like

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