Update marhun camera debugger
- Fix debugger by showing groupId of camera if the camera label is not available
This commit is contained in:
+19
-2
@@ -13,9 +13,26 @@ function marhunPhotoCapturerDebugger() {
|
|||||||
const generateCameraListing = (cameras) => {
|
const generateCameraListing = (cameras) => {
|
||||||
let title = "Available cameras: ";
|
let title = "Available cameras: ";
|
||||||
|
|
||||||
let content = cameras.map((camera, index) => {
|
let mapCameraWithDeviceId = (index, camera) => {
|
||||||
index = index + 1;
|
index = index + 1;
|
||||||
return `${index}. ${camera.label}\n`;
|
return `${index}. deviceLabel : ${camera.label}\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mapCameraWithGroupId = (index, camera) => {
|
||||||
|
index = index + 1;
|
||||||
|
return `${index}. groupId : ${camera.groupId}\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
let content = cameras.map((camera, index) => {
|
||||||
|
if(camera.deviceId !== ''){
|
||||||
|
return mapCameraWithDeviceId(index, camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(camera.groupId !== ''){
|
||||||
|
return mapCameraWithGroupId(index, camera);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return `${title}\n${content.join('')}`;
|
return `${title}\n${content.join('')}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user