WebRTC API wrapper to deal with different browsers.
- With npm:
$ npm install rtcninja
- With bower:
$ bower install rtcninja
var rtcninja = require('rtcninja');
Take a browserified version of the library from the dist/
folder:
dist/rtcninja-X.Y.Z.js
: The uncompressed version.dist/rtcninja-X.Y.Z.min.js
: The compressed production-ready version.dist/rtcninja.js
: A copy of the uncompressed version.dist/rtcninja.min.js
: A copy of the compressed version.
They expose the global window.rtcninja
module.
<script src='rtcninja-X.Y.Z.js'></script>
// Must first call it.
rtcninja();
// Then check.
if (rtcninja.hasWebRTC()) {
// Do something.
}
else {
// Do something.
}
You can read the full API documentation in the docs folder.
The library includes the Node debug module. In order to enable debugging:
In Node set the DEBUG=rtcninja*
environment variable before running the application, or set it at the top of the script:
process.env.DEBUG = 'rtcninja*';
In the browser run rtcninja.debug.enable('rtcninja*');
and reload the page. Note that the debugging settings are stored into the browser LocalStorage. To disable it run rtcninja.debug.disable('rtcninja*');
.
Iñaki Baz Castillo at eFace2Face.
ISC.