import { printErrorDetail } from '../Utils'; export class WeCameraInput { constructor(m15, n15, o15) { this.onSysCameraInputError = async (q15) => { this.onError(q15); }; this.cameraInput = m15.createCameraInput(n15); this.stateListener = o15; this.sysCamera = n15; this.cameraInput.on("error", this.sysCamera, this.onSysCameraInputError); } getSystemCameraInput() { return this.cameraInput; } async open() { try { await this.cameraInput.open().then(() => { this.stateListener?.onOpen(); }); } catch (k15) { printErrorDetail(k15); this.stateListener?.onError(k15); } } async close() { try { await this.cameraInput.close().then(() => this.stateListener?.onClose()); } catch (i15) { this.stateListener?.onError(i15); printErrorDetail(i15); } } async onError(h15) { printErrorDetail(h15); this.stateListener?.onError(h15); } } 