advance hook: useCameraDevices

This commit is contained in:
Marc Rousavy
2021-02-22 09:43:47 +01:00
parent a6a465881a
commit 1ccbbae9e0
4 changed files with 31 additions and 21 deletions

View File

@@ -91,8 +91,8 @@ export const sortFormatsByResolution = (left: CameraDeviceFormat, right: CameraD
let rightPoints = right.photoHeight * right.photoWidth;
if (left.videoHeight != null && left.videoWidth != null && right.videoHeight != null && right.videoWidth != null) {
leftPoints += left.videoWidth * left.videoHeight ?? 0;
rightPoints += right.videoWidth * right.videoHeight ?? 0;
leftPoints += left.videoWidth * left.videoHeight;
rightPoints += right.videoWidth * right.videoHeight;
}
// "returns a negative value if left is better than one"