未验证 提交 914a3b74 编写于 作者: O openharmony_ci 提交者: Gitee

!19790 相机事件监听回调资料修改

Merge pull request !19790 from 马利/master
......@@ -75,7 +75,7 @@
通过注册cameraStatus事件,通过回调返回监听结果,callback返回CameraStatusInfo参数,参数的具体内容可参考相机管理器回调接口实例[CameraStatusInfo](../reference/apis/js-apis-camera.md#camerastatusinfo)
```ts
cameraManager.on('cameraStatus', (cameraStatusInfo) => {
cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
console.info(`camera: ${cameraStatusInfo.camera.cameraId}`);
console.info(`status: ${cameraStatusInfo.status}`);
})
......
......@@ -48,7 +48,7 @@ Metadata主要是通过一个TAG(Key),去找对应的Data,用于传递
- 通过注册监听获取metadata对象,监听事件固定为metadataObjectsAvailable。检测到有效metadata数据时,callback返回相应的metadata数据信息,metadataOutput创建成功时可监听。
```ts
metadataOutput.on('metadataObjectsAvailable', (metadataObjectArr) => {
metadataOutput.on('metadataObjectsAvailable', (err, metadataObjectArr) => {
console.info(`metadata output metadataObjectsAvailable`);
})
```
......
......@@ -22,7 +22,7 @@ if (!cameraManager) {
}
// 监听相机状态变化
cameraManager.on('cameraStatus', (cameraStatusInfo) => {
cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
console.log(`camera : ${cameraStatusInfo.camera.cameraId}`);
console.log(`status: ${cameraStatusInfo.status}`);
})
......
......@@ -21,7 +21,7 @@ if (!cameraManager) {
return;
}
// 监听相机状态变化
cameraManager.on('cameraStatus', (cameraStatusInfo) => {
cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
console.info(`camera : ${cameraStatusInfo.camera.cameraId}`);
console.info(`status: ${cameraStatusInfo.status}`);
})
......
......@@ -136,7 +136,7 @@
- 通过注册固定的captureStart回调函数获取监听拍照开始结果,photoOutput创建成功时即可监听,拍照第一次曝光时触发,该事件返回此次拍照的captureId。
```ts
photoOutput.on('captureStart', (captureId) => {
photoOutput.on('captureStart', (err, captureId) => {
console.info(`photo capture stated, captureId : ${captureId}`);
})
```
......@@ -144,7 +144,7 @@
- 通过注册固定的captureEnd回调函数获取监听拍照结束结果,photoOutput创建成功时即可监听,该事件返回结果为拍照完全结束后的相关信息[CaptureEndInfo](../reference/apis/js-apis-camera.md#captureendinfo)
```ts
photoOutput.on('captureEnd', (captureEndInfo) => {
photoOutput.on('captureEnd', (err, captureEndInfo) => {
console.info(`photo capture end, captureId : ${captureEndInfo.captureId}`);
console.info(`frameCount : ${captureEndInfo.frameCount}`);
})
......
......@@ -576,7 +576,7 @@ on(type: 'cameraMute', callback: AsyncCallback\<boolean\>): void
**示例:**
```js
cameraManager.on('cameraMute', (curMuetd) => {
cameraManager.on('cameraMute', (err, curMuetd) => {
let isMuted = curMuetd;
})
```
......@@ -2283,7 +2283,7 @@ on(type: 'focusStateChange', callback: AsyncCallback\<FocusState\>): void
**示例:**
```js
captureSession.on('focusStateChange', (focusState) => {
captureSession.on('focusStateChange', (err, focusState) => {
console.log(`Focus state : ${focusState}`);
})
```
......@@ -2885,7 +2885,7 @@ on(type: 'captureStart', callback: AsyncCallback\<number\>): void
**示例:**
```js
photoOutput.on('captureStart', (captureId) => {
photoOutput.on('captureStart', (err, captureId) => {
console.log(`photo capture stated, captureId : ${captureId}`);
})
```
......@@ -2908,7 +2908,7 @@ on(type: 'frameShutter', callback: AsyncCallback\<FrameShutterInfo\>): void
**示例:**
```js
photoOutput.on('frameShutter', (frameShutterInfo) => {
photoOutput.on('frameShutter', (err, frameShutterInfo) => {
console.log(`photo capture end, captureId : ${frameShutterInfo.captureId}`);
console.log(`Timestamp for frame : ${frameShutterInfo.timestamp}`);
})
......@@ -2932,7 +2932,7 @@ on(type: 'captureEnd', callback: AsyncCallback\<CaptureEndInfo\>): void
**示例:**
```js
photoOutput.on('captureEnd', (captureEndInfo) => {
photoOutput.on('captureEnd', (err, captureEndInfo) => {
console.log(`photo capture end, captureId : ${captureEndInfo.captureId}`);
console.log(`frameCount : ${captureEndInfo.frameCount}`);
})
......@@ -3380,7 +3380,7 @@ on(type: 'metadataObjectsAvailable', callback: AsyncCallback\<Array\<MetadataObj
**示例:**
```js
metadataOutput.on('metadataObjectsAvailable', (metadataObjectArr) => {
metadataOutput.on('metadataObjectsAvailable', (err, metadataObjectArr) => {
console.log(`metadata output metadataObjectsAvailable`);
})
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册