DART中的WebRTC连接:HTML,不完整的API?
在以下JavaScript片段中,飞镖的等效是什么?
myPeerConnection.createOffer().then(function(offer) {
return myPeerConnection.setLocalDescription(offer);
})
直接翻译:
final offer = await myPeerConnection.createOffer();
myPeerConnection.setLocalDescription(offer);
不编译,因为createOffer()
最终返回rtcSessionDescription
和setlocaldescription仅接受MAP
。
rtcSessionDescription
没有一种很好的方法来转换API中的MAP
。
我错过了什么吗?谢谢!
What would be the equivalent in dart of the following javascript snippet?
myPeerConnection.createOffer().then(function(offer) {
return myPeerConnection.setLocalDescription(offer);
})
The straight translation:
final offer = await myPeerConnection.createOffer();
myPeerConnection.setLocalDescription(offer);
does not compile because createOffer()
eventually returns a RtcSessionDescription
and setLocalDescription accepts only a Map
.
And RtcSessionDescription
does not have a nice way to convert to a Map
in the API.
Am I missing anything? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试了几件事后,这在我的用例中起作用(至少在Chrome中):
After trying a few things, this works in my use case (at least in Chrome):