Created
May 11, 2019 01:38
-
-
Save quangtqag/a6e6416caeec433f3ccae89044372644 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
func answer(completion: @escaping (_ sdp: RTCSessionDescription) -> Void) { | |
let constrains = RTCMediaConstraints(mandatoryConstraints: self.mediaConstrains, | |
optionalConstraints: nil) | |
self.peerConnection!.answer(for: constrains) { (sdp, error) in | |
guard let sdp = sdp else { | |
return | |
} | |
self.peerConnection!.setLocalDescription(sdp, completionHandler: { (error) in | |
completion(sdp) | |
}) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment