-
-
Save zontan/d5808474768a60f10aa48631663d64aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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