use const

This commit is contained in:
Josh Hawkins 2026-03-09 16:16:07 -05:00
parent 0a5af3a90f
commit d52e37d72d

View File

@ -125,6 +125,10 @@ export type CameraAudioFeatures = {
* @param streamHeight - Native stream height in pixels * @param streamHeight - Native stream height in pixels
* @returns Detect dimensions with even values, or null if inputs are invalid * @returns Detect dimensions with even values, or null if inputs are invalid
*/ */
// Target size for the smaller dimension (width or height) for detect streams
export const DETECT_TARGET_PX = 720;
export function calculateDetectDimensions( export function calculateDetectDimensions(
streamWidth: number, streamWidth: number,
streamHeight: number, streamHeight: number,
@ -139,7 +143,7 @@ export function calculateDetectDimensions(
} }
const smallerDim = Math.min(streamWidth, streamHeight); const smallerDim = Math.min(streamWidth, streamHeight);
const target = Math.min(720, smallerDim); const target = Math.min(DETECT_TARGET_PX, smallerDim);
const scale = target / smallerDim; const scale = target / smallerDim;
let width = Math.round(streamWidth * scale); let width = Math.round(streamWidth * scale);