Code Monkey home page Code Monkey logo

node-webrtc's Introduction

    

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. Some MediaStream APIs are supported now!.

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 Platform 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

MediaStream Loopback Example

This example demonstrates relaying MediaStreamTracks through node-webrtc. Run the example with

node examples/loopback.server.js

Then navigate to http://localhost:8080/loopback.client.html. You should be prompted for your microphone and webcam. Once granted, the browser negotiates an RTCPeerConnection with the server, and the server relays the browser's MediaStreamTracks. Finally, these are displayed in a <video> element in the browser.

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.

node-webrtc's People

Contributors

markandrus avatar piranna avatar helloiampau avatar guymguym avatar wouldgo avatar damonoehlman avatar kofd avatar ekr avatar rosskukulinski avatar caseywebdev avatar manuguerra avatar kkoopa avatar manur avatar nazar-pc avatar janza avatar williamberman avatar jonathanfrawley avatar davidburhans avatar blakelapierre avatar cjb avatar eadle avatar imyller avatar juniordiscart avatar jsonxr avatar josephfrazier avatar felixmcfelix avatar njohnst avatar olalonde avatar oklas avatar thanpolas avatar

Watchers

Roman Mashta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.