diff --git a/zh-cn/application-dev/media/camera-preformance-imporvement.md b/zh-cn/application-dev/media/camera-preformance-imporvement.md index 7af9a032701c8bd3124d7c72c0d76e988ea41598..f1fd07245c01adfce2ab029e58439e8bf3ce4b20 100644 --- a/zh-cn/application-dev/media/camera-preformance-imporvement.md +++ b/zh-cn/application-dev/media/camera-preformance-imporvement.md @@ -154,16 +154,16 @@ this.photoOutPut.on('quickThumbnail', (err, pixelmap) => { - **相机应用** -```js -import camera from '@ohos.multimedia.camera' + ```js + import camera from '@ohos.multimedia.camera' -this.cameraManager = camera.getCameraManager(globalThis.abilityContext); -let cameras = this.cameraManager.getSupportedCameras() -if(this.cameraManager.isPreLaunchSupported(cameras[0])) { - try { - this.cameraManager.setPreLaunchConfig({cameraDevice: cameras[0]}); - } catch (error) { - console.error(`catch error: Code: ${error.code}, message: ${error.message}`) + this.cameraManager = camera.getCameraManager(globalThis.abilityContext); + let cameras = this.cameraManager.getSupportedCameras() + if(this.cameraManager.isPreLaunchSupported(cameras[0])) { + try { + this.cameraManager.setPreLaunchConfig({cameraDevice: cameras[0]}); + } catch (error) { + console.error(`catch error: Code: ${error.code}, message: ${error.message}`) + } } -} -``` + ```