Socket
Socket
Sign inDemoInstall

easy-js-camera

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.1 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);
});
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc