js-platform/node-webrtc — pull request #128 by markandrus (2014-07-09 01:19:44+00:00)
Title: Add getUserMedia support

This pull request adds initial `getUserMedia` support to node-webrtc. `getUserMedia` has been discussed a little bit (e.g. #25, #43), and I'd like to see it added. For one, it would allow WebRTC clients to move more of their tests out of the browser and into the command-line.

You can use it like

```js
if (detected === NODE) {
var wrtc = require('wrtc');
RTCPeerConnection = wrtc.RTCPeerConnection;
RTCSessionDescription = wrtc.RTCSessionDescription;
RTCIceCandidate = wrtc.RTCIceCandidate;
getUserMedia = wrtc.getUserMedia;
} else if (detected === CHROME) {
RTCPeerConnection = window.webkitRTCPeerConnection;
getUserMedia = navigator.webkitGetUserMedia.bind(navigator);
}
```

I tested by making a call between Node.js and Chrome. [See here.](https://gist.github.com/markandrus/c1dad8607de5b7713214)

I'm not sure about functions `runImmediately`, `queueOrRun`, or `_executeNext` in `mediastream.js`, though.