1import { CameraType, ImageType } from './Camera.types'; 2 3// https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/aspectRatio 4export const VIDEO_ASPECT_RATIOS = { 5 '3840x2160': 3840 / 2160, 6 '1920x1080': 1920 / 1080, 7 '1280x720': 1280 / 720, 8 '640x480': 640 / 480, 9 '352x288': 352 / 288, 10}; 11 12export const PictureSizes = Object.keys(VIDEO_ASPECT_RATIOS); 13 14export const ImageTypeFormat = { 15 [ImageType.jpg]: 'image/jpeg', 16 [ImageType.png]: 'image/png', 17}; 18 19export const MinimumConstraints: MediaStreamConstraints = { 20 audio: false, 21 video: true, 22}; 23 24export const CameraTypeToFacingMode = { 25 [CameraType.front]: 'user', 26 [CameraType.back]: 'environment', 27}; 28 29export const FacingModeToCameraType = { 30 user: CameraType.front, 31 environment: CameraType.back, 32}; 33