getscreenmedia
Advanced tools
Comparing version 4.0.1 to 4.1.0
@@ -1,2 +0,2 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.getScreenMedia = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.getScreenMedia = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
// cache for constraints and callback | ||
@@ -16,12 +16,9 @@ var cache = {}; | ||
if (window.navigator.userAgent.match('Chrome')) { | ||
var chromever = parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1], 10); | ||
var maxver = 33; | ||
if (adapter.browserDetails.browser === 'chrome') { | ||
var chromever = adapter.browserDetails.version; | ||
var isCef = !window.chrome.webstore; | ||
// "known" crash in chrome 34 and 35 on linux | ||
if (window.navigator.userAgent.match('Linux')) maxver = 35; | ||
// check that the extension is installed by looking for a | ||
// sessionStorage variable that contains the extension id | ||
// this has to be set after installation unless the contest | ||
// this has to be set after installation unless the content | ||
// script does that | ||
@@ -68,7 +65,3 @@ if (sessionStorage.getScreenMediaJSExtensionId) { | ||
maxFrameRate: 3 | ||
}, | ||
optional: [ | ||
{googLeakyBucket: true}, | ||
{googTemporalLayeredScreencast: true} | ||
] | ||
} | ||
}}; | ||
@@ -83,3 +76,3 @@ constraints.video.mandatory.chromeMediaSourceId = sourceId; | ||
}); | ||
} else if (isCef || (chromever >= 26 && chromever <= maxver)) { | ||
} else if (isCef || (chromever >= 26 && chromever <= 35)) { | ||
// chrome 26 - chrome 33 way to do it -- requires bad chrome://flags | ||
@@ -113,5 +106,4 @@ // note: this is basically in maintenance mode and will go away soon | ||
} | ||
} else if (window.navigator.userAgent.match('Firefox')) { | ||
var ffver = parseInt(window.navigator.userAgent.match(/Firefox\/(.*)/)[1], 10); | ||
if (ffver >= 33) { | ||
} else if (adapter.browserDetails.browser === 'firefox') { | ||
if (adapter.browserDetails.version >= 33) { | ||
constraints = (hasConstraints && constraints) || { | ||
@@ -142,3 +134,16 @@ video: { | ||
error.name = 'EXTENSION_UNAVAILABLE'; // does not make much sense but... | ||
callback(error); | ||
} | ||
} else if (adapter.browserDetails.browser === 'MicrosoftEdge') { | ||
if ('getDisplayMedia' in window.navigator) { | ||
window.navigator.getDisplayMedia({video: true}).then(function (stream) { | ||
callback(null, stream); | ||
}).catch(function (err) { | ||
callback(err); | ||
}); | ||
} else { | ||
error = new Error('Screensharing is not supported'); | ||
error.name = 'NotSupportedError'; | ||
callback(error); | ||
} | ||
} | ||
@@ -168,7 +173,3 @@ }; | ||
maxFrameRate: 3 | ||
}, | ||
optional: [ | ||
{googLeakyBucket: true}, | ||
{googTemporalLayeredScreencast: true} | ||
] | ||
} | ||
}}; | ||
@@ -188,2 +189,2 @@ constraints.video.mandatory.chromeMediaSourceId = event.data.sourceId; | ||
},{}]},{},[1])(1) | ||
}); | ||
}); |
@@ -15,12 +15,9 @@ // cache for constraints and callback | ||
if (window.navigator.userAgent.match('Chrome')) { | ||
var chromever = parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1], 10); | ||
var maxver = 33; | ||
if (adapter.browserDetails.browser === 'chrome') { | ||
var chromever = adapter.browserDetails.version; | ||
var isCef = !window.chrome.webstore; | ||
// "known" crash in chrome 34 and 35 on linux | ||
if (window.navigator.userAgent.match('Linux')) maxver = 35; | ||
// check that the extension is installed by looking for a | ||
// sessionStorage variable that contains the extension id | ||
// this has to be set after installation unless the contest | ||
// this has to be set after installation unless the content | ||
// script does that | ||
@@ -67,7 +64,3 @@ if (sessionStorage.getScreenMediaJSExtensionId) { | ||
maxFrameRate: 3 | ||
}, | ||
optional: [ | ||
{googLeakyBucket: true}, | ||
{googTemporalLayeredScreencast: true} | ||
] | ||
} | ||
}}; | ||
@@ -82,3 +75,3 @@ constraints.video.mandatory.chromeMediaSourceId = sourceId; | ||
}); | ||
} else if (isCef || (chromever >= 26 && chromever <= maxver)) { | ||
} else if (isCef || (chromever >= 26 && chromever <= 35)) { | ||
// chrome 26 - chrome 33 way to do it -- requires bad chrome://flags | ||
@@ -112,5 +105,4 @@ // note: this is basically in maintenance mode and will go away soon | ||
} | ||
} else if (window.navigator.userAgent.match('Firefox')) { | ||
var ffver = parseInt(window.navigator.userAgent.match(/Firefox\/(.*)/)[1], 10); | ||
if (ffver >= 33) { | ||
} else if (adapter.browserDetails.browser === 'firefox') { | ||
if (adapter.browserDetails.version >= 33) { | ||
constraints = (hasConstraints && constraints) || { | ||
@@ -141,3 +133,16 @@ video: { | ||
error.name = 'EXTENSION_UNAVAILABLE'; // does not make much sense but... | ||
callback(error); | ||
} | ||
} else if (adapter.browserDetails.browser === 'MicrosoftEdge') { | ||
if ('getDisplayMedia' in window.navigator) { | ||
window.navigator.getDisplayMedia({video: true}).then(function (stream) { | ||
callback(null, stream); | ||
}).catch(function (err) { | ||
callback(err); | ||
}); | ||
} else { | ||
error = new Error('Screensharing is not supported'); | ||
error.name = 'NotSupportedError'; | ||
callback(error); | ||
} | ||
} | ||
@@ -167,7 +172,3 @@ }; | ||
maxFrameRate: 3 | ||
}, | ||
optional: [ | ||
{googLeakyBucket: true}, | ||
{googTemporalLayeredScreencast: true} | ||
] | ||
} | ||
}}; | ||
@@ -174,0 +175,0 @@ constraints.video.mandatory.chromeMediaSourceId = event.data.sourceId; |
{ | ||
"name": "getscreenmedia", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "A browser module for attempting to get access to a MediaStream of a user's screen. With a nice node-like API.", | ||
@@ -5,0 +5,0 @@ "main": "getscreenmedia.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
437
25421
12