Skip to content

Instantly share code, notes, and snippets.

@zontan
Created September 9, 2020 00:28
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/f0e15bb76443134cfb68af4c29421d14 to your computer and use it in GitHub Desktop.
Save zontan/f0e15bb76443134cfb68af4c29421d14 to your computer and use it in GitHub Desktop.
func initializeAgoraEngine() {
agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: "YOUR_AGORA_APP_ID", delegate: self)
agoraKit?.enableVideo() // - enable video
agoraKit?.setVideoSource(self.videoSource) // - set the video source to the custom source
agoraKit?.enableWebSdkInteroperability(true)
agoraKit?.setChannelProfile(.liveBroadcasting)
if let channel = roomName {
agoraKit?.joinChannel(byToken: nil, channelId: channel, info: nil, uid: 0, joinSuccess: { (channel, uid, elapsed) in
print("Join channel success")
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment