WEBRTC in the Chrome browser demo Many examples, WebRTC source, but in the Firefox browser, the example can not be used, the information on the web said to set the media.peerconnection.enabled to True, However, in the Firefox browser, the default value is True, using the WEBRTC example in Firefox or can not capture local video.
Here are the examples found online:
Firefox Demo WEBRTC's website: http://conversat.io/
The most critical thing is to simplewebrtc.js this script.
Simplewebrtc.js encapsulates WebRTC Technology's JavaScript to help you simplify WebRTC application development.
Example code:
1 |
var webrtc =new WebRTC ({ |
2 |
The id/element DOM element that would hold "our" video |
3 |
Localvideoel: ' Localvideo ', |
4 |
The id/element DOM element that would hold the remote videos |
5 |
Remotevideosel: ' Remotesvideos ', |
6 |
Immediately ask for camera access |
Conversat.io is a voice group chat app. You only need to log in with a browser that supports WEBRTC, set up a chat room, and then you can have a video chat with up to 6 people-no landing, no other services, only video chat.
Currently, there are only two browsers that support the WEBRTC component running Conversat.io,chrome and the nightly version of Firefox (you need to go to Firefox about: Config enable media.peerconnection.enabled personalization, in fact no need, default this option is already true) Conversat.io is a very cool demonstration, WEBRTC is in the initial stage, sometimes the application is more tricky, so, The new library was later introduced.
As Henrik Joreteg wrote on the hacks blog, "There are two goals for Conversat.io, one is an important communication tool ... Second, he is a simplewebrtc.js library and a small signaling server running the demo, Signelmaster. ”
As part of the WEBRTC package, these two tools are designed to simplify the writing process of WEBRTC applications-such as WEBRTC jquery. Two libraries are open source (MIT licensed) and constantly perfected and evolved on GitHub.
If you want to learn more about SIMPLEWEBRTC and signalmaster, and see more code, see Mozilla Hacks Blog for more details.
What we can do if there are millions of eight cores and even more nuclear mobile devices. Instead of thinking about WEBRTC, this technique can actually implement point-to-point in the browser. You might as well look at Peerjs and simplewebrtc.js. In my opinion, we seem to be able to put the expensive backend servers aside and explore a sustainable computing model that uses mobile device collaboration.
http://blog.csdn.net/langeldep/article/details/8787120