Capture desktop video using webrtc
npm install screen-recordCapture desktop video using webrtc
This client-side module is installed via npm:
`` bash`
$ npm install screen-record
It is a client-side browser that gives desktop recording capabilities to Chrome
when this Chrome Extension is installed.
` js
var screenRecord = require('screen-record'),
getUserMedia = require('getusermedia');
screenRecord(window, (err, sourceId, constraints) => {
if (err) throw err;
getUserMedia(constraints, function (err, stream) {
if (err) throw err;
// now have a webRTC stream of the desktop
})
});
`
Asks the Chome Extension to ask the user to authorize and pick a window or
the whole desktop to record.
* window - Optional DOM window object to use to do screen recording magicIFRAME
( insertion, postMessage etc).cb(err, sourceId, constraints)
* - Callback:err
* - ErrorsourceId
* - The unique webrtc source ID string, that can be passed throughgetUserMedia
a constraints object in to then create a webrtc stream.constraints
* - Prefilled and ready-to-use getUserMedia constraints objectsourceId` is already correctly populated.
that can be directly used. The
This is a simple commonjs adaptation of the code originally created by
@muaz-khan and is designed to work with this
Chrome Extension
The original code can be found here
As per the original license, this is licensed under the
MIT License