Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var remoteUserIDs: [UInt] = []
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return remoteUserIDs.count
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "videoCell", for: indexPath)
let remoteID = remoteUserIDs[indexPath.row]
if let videoCell = cell as? VideoCollectionViewCell {
let videoCanvas = AgoraRtcVideoCanvas()
videoCanvas.uid = remoteID
videoCanvas.view = videoCell.videoView
videoCanvas.renderMode = .fit
getAgoraEngine().setupRemoteVideo(videoCanvas)
}
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.