Update marhun camera debugger

- Fix debugger by showing groupId of camera if the camera label is not
  available
This commit is contained in:
afiq.hamzah
2023-01-03 11:06:36 +08:00
parent 3b6c8b4954
commit 99a6df9d7c
+19 -2
View File
@@ -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('')}`;