Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

getscreenmedia

Package Overview
Dependencies
Maintainers
6
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getscreenmedia - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

56

getscreenmedia.js

@@ -1,3 +0,2 @@

// getScreenMedia helper by @HenrikJoreteg
var getUserMedia = require('getusermedia');
var adapter = require('webrtc-adapter');

@@ -47,3 +46,7 @@ // cache for constraints and callback

constraints.video.mandatory.chromeMediaSourceId = data.sourceId;
getUserMedia(constraints, callback);
window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
callback(null, stream);
}).catch(function (err) {
callback(err);
});
}

@@ -73,3 +76,7 @@ }

constraints.video.mandatory.chromeMediaSourceId = sourceId;
getUserMedia(constraints, callback);
window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
callback(null, stream);
}).catch(function (err) {
callback(err);
});
}

@@ -91,3 +98,7 @@ });

};
getUserMedia(constraints, callback);
window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
callback(null, stream);
}).catch(function (err) {
callback(err);
});
} else {

@@ -112,18 +123,17 @@ // chrome 34+ way requiring an extension

};
getUserMedia(constraints, function (err, stream) {
callback(err, stream);
// workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1045810
if (!err) {
var lastTime = stream.currentTime;
var polly = window.setInterval(function () {
if (!stream) window.clearInterval(polly);
if (stream.currentTime == lastTime) {
window.clearInterval(polly);
if (stream.onended) {
stream.onended();
}
window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
callback(null, stream);
var lastTime = stream.currentTime;
var polly = window.setInterval(function () {
if (!stream) window.clearInterval(polly);
if (stream.currentTime == lastTime) {
window.clearInterval(polly);
if (stream.onended) {
stream.onended();
}
lastTime = stream.currentTime;
}, 500);
}
}
lastTime = stream.currentTime;
}, 500);
}).catch(function (err) {
callback(err);
});

@@ -165,3 +175,7 @@ } else {

constraints.video.mandatory.chromeMediaSourceId = event.data.sourceId;
getUserMedia(constraints, callback);
window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
callback(null, stream);
}).catch(function (err) {
callback(err);
});
}

@@ -168,0 +182,0 @@ } else if (event.data.type == 'getScreenPending') {

{
"name": "getscreenmedia",
"version": "2.0.0",
"version": "3.0.0",
"description": "A browser module for attempting to get access to a MediaStream of a user's screen. With a nice node-like API.",

@@ -19,4 +19,4 @@ "main": "getscreenmedia.js",

"license": "MIT",
"dependencies": {
"getusermedia": "^2.0.0"
"peerDependencies": {
"webrtc-adapter": "^3.1.6"
},

@@ -23,0 +23,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc