JSPM

  • Created
  • Published
  • Downloads 9486
  • Score
    100M100P100Q123063F
  • License BSD-2-Clause

Standards-compliant WebRTC implementation for Node

Package Exports

  • wrtc

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wrtc) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

    

NPM macOS/Linux Build Status Windows Build status

node-webrtc provides Node.js bindings to WebRTC M60. You can write Node.js applications that use RTCDataChannels with it. MediaStream APIs are not supported at this time.

x86 x64 arm arm64
Linux ✔︎
macOS ✔︎
Windows ✔︎

Getting Started

Prerequisites

This library will attempt to download pre-compiled binaries for your particular platform using node-pre-gyp; however, if binaries are unavailable, it will fallback to building from source. In this case, the prerequisites for building from source are the same as node-cmake. Refer to node-cmake for the particular prerequisites for your platform.

Install

The easiest way to install is via npm:

npm install wrtc

If you want to work from source, run

git clone https://github.com/js-platform/node-webrtc.git
cd node-webrtc
npm install

Build

If you would like to build libwebrtc and node-webrtc from source (you must if you're using arm), run

git clone https://github.com/aisouard/libwebrtc
cd libwebrtc
mkdir out
cd out
cmake -DWEBRTC_BRANCH_HEAD=refs/branch-heads/57 ..
make
# wait for a while
cd <path of node-webrtc>
mkdir -p third_party/webrtc
cp -r <path of libwebrtc>/out/lib third_party/webrtc
cp -r <path of libwebrtc>/out/include third_party/webrtc
export SKIP_DOWNLOAD=true
export CC=gcc-4.8
export CXX=g++-4.8
npm run install

Note: These instructions need to be updated for WebRTC M60.

Tests

node-webrtc Tests

Once everything is built, run

npm test

Web Plattorm Tests

w3c/web-platform-tests defines a suite of WebRTC tests. node-webrtc borrows a technique from jdom/jsdom to run these tests in Node.js. Run the tests with

npm run wpt:test

Contributing

The best way to get started is to read through the Getting Started and Example sections before having a look through the open issues. Some of the issues are marked as good first bug, but feel free to contribute to any of the issues there, or open a new one if the thing you want to work on isn't there yet.

Once you've done some hacking and you'd like to have your work merged, you'll need to make a pull request. If your patch includes code, make sure to check that all the unit tests pass, including any new tests you wrote. Finally, make sure you add yourself to the AUTHORS file.

Whenever possible, prefer making pull requests to opening issues.