Comparing version 0.0.8 to 0.0.9
@@ -81,2 +81,3 @@ /** | ||
private speaker?; | ||
private screen?; | ||
testMicrophone(handle: Function): Promise<{ | ||
@@ -94,2 +95,6 @@ yes: () => void; | ||
}; | ||
testShareScreen(handle: Function): Promise<{ | ||
yes: () => void; | ||
no: () => void; | ||
}>; | ||
} | ||
@@ -96,0 +101,0 @@ export declare function getTester(): Tester; |
@@ -292,2 +292,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
testShareScreen(handle) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
let video = document.createElement('video'); | ||
video.autoplay = true; | ||
video.loop = true; | ||
video.controls = true; | ||
let mediaDevices = navigator.mediaDevices; | ||
let stream = yield mediaDevices.getDisplayMedia({ video: true }); | ||
video.srcObject = stream; | ||
handle(video); | ||
const stop = () => { | ||
stream.getTracks()[0].stop(); | ||
}; | ||
return { | ||
yes: () => { | ||
this.screen = true; | ||
stop(); | ||
}, no: () => { | ||
this.screen = false; | ||
stop(); | ||
} | ||
}; | ||
} | ||
catch (e) { | ||
this.screen = false; | ||
return { | ||
yes: () => { | ||
}, | ||
no: () => { | ||
}, | ||
}; | ||
} | ||
}); | ||
} | ||
} | ||
@@ -294,0 +329,0 @@ export function getTester() { |
{ | ||
"name": "detection", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"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
15521
438