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

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

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