Comparing version 0.0.1 to 0.0.2
@@ -49,2 +49,3 @@ /** | ||
video: DeviceError | boolean; | ||
screen: DeviceError | boolean; | ||
readonly devices: Array<Device>; | ||
@@ -51,0 +52,0 @@ constructor(); |
@@ -56,2 +56,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
this.video = true; | ||
this.screen = true; | ||
this.devices = []; | ||
@@ -132,9 +133,19 @@ } | ||
let deviceInfo = new DeviceInfo(); | ||
for (let device of ['audio', 'video']) { | ||
for (let device of ['audio', 'video', 'screen']) { | ||
try { | ||
let options = {}; | ||
options[device] = true; | ||
let stream = yield navigator.mediaDevices.getUserMedia(options); | ||
let track = stream.getTracks()[0]; | ||
track.stop(); | ||
let stream, mediaDevices = navigator.mediaDevices; | ||
if (device === 'screen') { | ||
if (!mediaDevices.getDisplayMedia) { | ||
deviceInfo[device] = false; | ||
} | ||
else { | ||
stream = yield mediaDevices.getDisplayMedia(); | ||
} | ||
} | ||
else { | ||
let options = {}; | ||
options[device] = true; | ||
stream = yield mediaDevices.getUserMedia(options); | ||
} | ||
stream && stream.getTracks()[0].stop(); | ||
// @ts-ignore | ||
@@ -141,0 +152,0 @@ } |
{ | ||
"name": "detection", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
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
12498
349