WebRTC是一个实验性技术。
由于该技术的规格尚未稳定下来,在各浏览器中必须经过检查属性表的前缀来正确使用,例如:在Chrome中使用 webkitRTCPeerConnection,在Firefox中使用mozRTCPeerConnection,前缀不同。另外请注意,实验性技术的语法和行为有可能在浏览器将来的版本中改变。html
WebRTC API被设计为容许JS应用程序经过浏览器在用户之间建立实时的音频,视频和/或数据信道链接,或与支持WebRTC协议的服务器通讯。它还利用navigator.mozGetUserMedia()函数方法来访问麦克风和摄像头数据(getUserMedia()函数已经在标准化媒体捕获小组日程上)。html5
不断变化的WebRTC规范主要来源是W3的WebRTC 和getUserMedia 规范,以及在IETF的各类草案,主要是rtcweb工做组,MMUSIC,rmcat和其余几个组。在Chrome和Firefox实现的WebRTC功能,大部分代码是基于谷歌在webrtc.org上的开源。git
提示:若是在浏览器安装了FlashBlock,当前版本的FlashBlock插件可能默认会拦截HTML5的video标签组件;若是要在页面上使用WebRTC的视频功能,须要设置FlashBlock容许该video组件,或者在该页面禁用FlashBlock工具。github
在HTML5 Rocks 上有一个很是不错的介绍WebRTC基本功能的教程。在webrtc-landing 上有一个基本的测试页面的集合,用以支持发展webrtc的发展。web
你可使用Chrome在apprtc.appspot.com上作一个很简单的P2P的通讯实验,体验WebRTC的点到点通讯技术。浏览器
有一篇骇客文章 更形象的描述了创建RTCPeerConnection过程当中发生了什么(在这里阅读全部关于WebRTC的骇客文章):
服务器
<table> <tbody> <tr> <th>规范</th> <th>状态</th> <th>说明</th> </tr> <tr> <td>WebRTC API</td> <td>在定义中</td> <td> </td> </tr> <tr> <td>getUserMedia API</td> <td>在定义中</td> <td><a href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html" title="http://dev.w3.org/2011/webrtc/editor/getusermedia.html">http://dev.w3.org/2011/webrtc/editor/getusermedia.html</a></td> </tr> </tbody> </table>app
<table> <caption>PC桌面浏览器</caption> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>Yes<span class="inlineIndicator prefixBox prefixBoxInline" title="prefix">webkit</span></td> <td>Firefox 22</td> <td>Not supported</td> <td>Not supported</td> <td>Not supported</td> </tr> <tr> <td>DataChannels</td> <td>Will be in Chrome 29</td> <td>Firefox 22</td> <td>Not supported</td> <td>Not supported</td> <td>Not supported</td> </tr> </tbody> </table> </table> ide
<table> <caption>移动端浏览器</caption> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Preliminary support</td> <td>Via Chrome (behind flag)</td> <td>Activated on Nightly and Aurora</td> <td>Not supported</td> <td>Not supported</td> <td>Not supported</td> </tr> <tr> <td>DataChannels</td> <td>Compatibility unknown; please update this.</td> <td>Activated on Nightly and Aurora</td> <td>Not supported</td> <td>Not supported</td> <td>Not supported</td> </tr> </tbody> </table>函数