import { WebCameraCore, FacingMode } from "./webcam-core"; /** * Display list of user media that user can use then let user flip/select camera themself * Feature * - Filter out known Media label that not compatible for facing parameters * - Use facingMode = "any" to display all media to user * - Rotate to next media automatically if system can't access to specific media stream (This may prompt * another permission request to user) */ export default class FlippableWebCamera extends WebCameraCore { protected _webcamList: MediaDeviceInfo[]; protected _cameraIndex: number; protected _selectedDeviceId: string; constructor(webcamElement: HTMLVideoElement, facingMode?: FacingMode, canvasElement?: HTMLCanvasElement | null, snapSoundElement?: HTMLAudioElement | null); get webcamList(): MediaDeviceInfo[]; get webcamCount(): number; get selectedDeviceId(): string; protected getWebCamList(): Promise; /** * Start Web Camera * 1. Get all video input devices info and permission from user * 2. Start default stream * @returns */ start(): Promise; mountAnyWebCamForPermission(): Promise; /** * This will try to mount media to webcamElement and will automatically * change index number to find the next working media, if it cannot open specific media at provided index. * It will stop finding next media then throw error if no media can be mount. * * @param index Index of media to run in webcamList array * @param remountIndex internal use only */ mountWebCamIndex(index: number, remountIndex?: number): Promise; protected getMediaConstraintsForSpecificDeviceInfo(deviceId: string): MediaStreamConstraints; flip(): Promise; }