这是一个基于块的 WebRTC 的 RTCPeerConnection API(以及一个更友好的 init
方法)。我已经将相同的 API 提交给 WebRTC 项目,但尚未合并,并且我想在没有创建自定义构建的情况下让其他项目使用此 API。
我添加了一个更友好的 init
方法,它提供了一些默认约束。
JAHPeerConnection* peerConnection = [[TLKPeerConnection alloc] initWithICEServers:servers constraints:constraints peerConnectionFactory:peerConnectionFactory];
peerConnection.delegate = self;
基于代理的 API 已被基于块的 API 替换。
[self.peerConnection createOfferWithConstraints:constraints completion:^(RTCSessionDescription *sessionDescription, NSError *error) {
// Do other stuff now that we have the offer
}];
MIT
这由 @hjon 创建。