🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

easy-js-camera

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-js-camera - npm Package Compare versions

Comparing version

to
1.1.2

2

package.json
{
"name": "easy-js-camera",
"version": "1.1.1",
"version": "1.1.2",
"description": "A package which helps with adding camera support to a web application",

@@ -5,0 +5,0 @@ "main": "lib/Camera.js",

@@ -49,2 +49,11 @@ # Intro

* **stop:** This method is responsible for stoping the stream.
* **switch:** This method switches the camera between `front` and `rear`. This method returns a promise. It is better that you disable the switch camera button while it is doing its job because on some phones with `motorized` selfie camera if the user press the button multiple times the camera will hang and will just stickout and no longer works unless he/she restarts the phone.
* **switch:** This method switches the camera between `front` and `rear`. This method returns a promise. It is better that you disable the switch camera button while it is doing its job because on some phones with `motorized` selfie camera if the user press the button multiple times the camera will hang and will just stickout and no longer works unless he/she restarts the phone. Please **Note** that this method accept a boolean which is called `tryAgain` and it basically tries to access the rear camera. Sometime the rear camera is not accessible and on catch you can do something like below
```
function switchCamera(tryAgain = false) {
this.camera.switch(tryAgain)
.catch(() => {
if(tryAgain) return; // This line prevent loops. Because the tryAgain may also fail
this.camera.switch(true);
});
}
```