adapter for webrtc

2022-09-09 17:38:05 浏览数 (2)

浏览器直接调用webrtc相关api接口,比如调用PeerConnection。 但是实际上不同浏览器上可能这个API不同:

W3C Standard

Chrome

Firefox

getUserMedia

webkitGetUserMedia

mozGetUserMedia

RTCPeerConnection

webkitRTCPeerConnection

RTCPeerConnection

RTCSessionDescription

RTCSessionDescription

RTCSessionDescription

RTCIceCandidate

RTCIceCandidate

RTCIceCandidate

Note: 参考WebRTC APIs Interop页面的描述。

所以对于H5,推荐用一个adapter.js来支持各种浏览器。

adapter.js is a shim to insulate apps from spec changes and prefix differences in WebRTC. The prefix differences are mostly gone these days but differences in behaviour between browsers remain.

This repository used to be part of the WebRTC organisation on github but moved. We aim to keep the old repository updated with new releases.

这个库的API调用例子,参考Samples,比如PC应该用RTCPeerConnection。

0 人点赞