Socket
Socket
Sign inDemoInstall

detection

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detection - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

1

lib/index.d.ts

@@ -49,2 +49,3 @@ /**

video: DeviceError | boolean;
screen: DeviceError | boolean;
readonly devices: Array<Device>;

@@ -51,0 +52,0 @@ constructor();

23

lib/index.js

@@ -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",

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