Skip to content

Instantly share code, notes, and snippets.

@zontan
Last active September 23, 2019 23:01
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/d9e2cf294d5e28b1f91a68ec95842ab1 to your computer and use it in GitHub Desktop.
Save zontan/d9e2cf294d5e28b1f91a68ec95842ab1 to your computer and use it in GitHub Desktop.
func joinChannel() {
localVideoView.isHidden = false
if let name = userName {
getAgoraEngine().joinChannel(byUserAccount: name, token: tempToken, channelId: channelName) { [weak self] (sid, uid, elapsed) in
self?.userID = uid
}
} else {
getAgoraEngine().joinChannel(byToken: tempToken, channelId: channelName, info: nil, uid: userID) { [weak self] (sid, uid, elapsed) in
self?.userID = uid
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment