Skip to content

Instantly share code, notes, and snippets.

@zontan
Created September 13, 2019 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zontan/d5808474768a60f10aa48631663d64aa to your computer and use it in GitHub Desktop.
Save zontan/d5808474768a60f10aa48631663d64aa to your computer and use it in GitHub Desktop.
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