🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

node-red-node-ui-webcam

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-node-ui-webcam - npm Package Compare versions

Comparing version
0.4.0
to
0.5.0
+1
-1
package.json
{
"name": "node-red-node-ui-webcam",
"version": "0.4.0",
"version": "0.5.0",
"description": "A Node-RED ui node to capture images from a webcam.",

@@ -5,0 +5,0 @@ "author": "Nick O'Leary",

@@ -386,12 +386,21 @@ /**

if (msg.camera !== undefined) {
if (!isNaN(parseInt(msg.camera))) {
var c = parseInt(msg.camera);
if (c >= 0 || c < 16) {
oldActiveCamera = activeCamera;
$scope.disableCamera();
activeCamera = null;
window.localStorage.setItem("node-red-node-ui-webcam-activeCam",c);
if (active !== false) {
$scope.enableCamera();
}
let c = parseInt(msg.camera);
if (!isNaN(c)) {
// Check if cameras array is populated
if ($scope.data.cameras && $scope.data.cameras.length > c) {
$scope.changeCamera(c);
} else {
// Enumerate devices first, then change camera
navigator.mediaDevices.enumerateDevices().then(function(devices) {
$scope.data.cameras = devices.filter(function(device) {
return device.kind === "videoinput";
});
if (c >= 0 && c < $scope.data.cameras.length) {
$scope.changeCamera(c);
} else {
console.warn("Camera index out of range:", c);
}
}).catch(function(err) {
console.error("Error enumerating devices:", err);
});
}

@@ -398,0 +407,0 @@ }