Skip to content

Commit

Permalink
Merged and closed #27
Browse files Browse the repository at this point in the history
  • Loading branch information
muaz-khan committed Mar 11, 2017
1 parent 20b1caa commit fe1e316
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
23 changes: 17 additions & 6 deletions DetectRTC.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Last time updated: 2017-03-05 5:56:31 AM UTC
// Last time updated: 2017-03-11 6:22:53 AM UTC

// Latest file can be found here: https://cdn.webrtc-experiment.com/DetectRTC.js

Expand Down Expand Up @@ -742,7 +742,7 @@

if (!device.label) {
device.label = 'Please invoke getUserMedia once.';
if (location.protocol !== 'https:') {
if (DetectRTC.browser.isChrome && DetectRTC.browser.version >= 46 && !/^(https:|chrome-extension:)$/g.test(location.protocol || '')) {
if (document.domain.search && document.domain.search(/localhost|127.0./g) === -1) {
device.label = 'HTTPs is required to get label of this ' + device.kind + ' device.';
}
Expand Down Expand Up @@ -854,8 +854,15 @@
isScreenCapturingSupported = true;
}

if (location.protocol !== 'https:') {
isScreenCapturingSupported = false;
if (!/^(https:|chrome-extension:)$/g.test(location.protocol || '')) {
if (document.domain.search && document.domain.search(/localhost|127.0./g) === -1) {
// DetectRTC.browser.isChrome
isScreenCapturingSupported = false;
}

if (DetectRTC.browser.isFirefox) {
isScreenCapturingSupported = false;
}
}
DetectRTC.isScreenCapturingSupported = isScreenCapturingSupported;

Expand Down Expand Up @@ -910,9 +917,13 @@
} else if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
isGetUserMediaSupported = true;
}
if (DetectRTC.browser.isChrome && DetectRTC.browser.version >= 46 && location.protocol !== 'https:') {
isGetUserMediaSupported = 'Requires HTTPs';

if (DetectRTC.browser.isChrome && DetectRTC.browser.version >= 46 && !/^(https:|chrome-extension:)$/g.test(location.protocol || '')) {
if (document.domain.search && document.domain.search(/localhost|127.0./g) === -1) {
isGetUserMediaSupported = 'Requires HTTPs';
}
}

if (DetectRTC.osName === 'Nodejs') {
isGetUserMediaSupported = false;
}
Expand Down
Loading

0 comments on commit fe1e316

Please sign in to comment.