提交 f544ebb0 编写于 作者: Z zengyawen

update docs

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 d0091fb6
...@@ -154,16 +154,16 @@ this.photoOutPut.on('quickThumbnail', (err, pixelmap) => { ...@@ -154,16 +154,16 @@ this.photoOutPut.on('quickThumbnail', (err, pixelmap) => {
- **相机应用** - **相机应用**
```js ```js
import camera from '@ohos.multimedia.camera' import camera from '@ohos.multimedia.camera'
this.cameraManager = camera.getCameraManager(globalThis.abilityContext); this.cameraManager = camera.getCameraManager(globalThis.abilityContext);
let cameras = this.cameraManager.getSupportedCameras() let cameras = this.cameraManager.getSupportedCameras()
if(this.cameraManager.isPreLaunchSupported(cameras[0])) { if(this.cameraManager.isPreLaunchSupported(cameras[0])) {
try { try {
this.cameraManager.setPreLaunchConfig({cameraDevice: cameras[0]}); this.cameraManager.setPreLaunchConfig({cameraDevice: cameras[0]});
} catch (error) { } catch (error) {
console.error(`catch error: Code: ${error.code}, message: ${error.message}`) console.error(`catch error: Code: ${error.code}, message: ${error.message}`)
} }
} }
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册