How to get started with WebRTC?

I am starting out with WebRTC and I would like to know if there is anything that I need to import in order to use the JavaScript API.

+4
source share
3 answers

No, you do not need to import any library. webRTC is included in Chrome and Firefox (as well as for the beta version of Chrome and Firefox on Android).

Your error may be due to the fact that you need to prefix it with webkit as follows:

 peer = new webkitRTCPeerConnection(...) 
+8
source

When I started, I found this article the easiest: http://www.html5rocks.com/en/tutorials/webrtc/basics/

+2
source

You don’t need to enable anything to use WebRTC APIs, but in practical terms, you probably want to use an adapter to normalize the differences between API names between browser developers (e.g. webkitGetUserMedia / mozGetuserMedia).

Google maintains a good adapter that does this, and handles several errors that may occur when used directly.

Just include the following script page on the page.

https://code.google.com/p/webrtc/source/browse/trunk/samples/js/base/adapter.js

+2
source

Source: https://habr.com/ru/post/1501102/


All Articles