提交 660ad814 编写于 作者: J jiangminyang

fixed some excemple code issue.

Signed-off-by: Njiangminyang <jiangminyang@huawei.com>
上级 d17dc197
......@@ -347,7 +347,7 @@ After **[camera.getCameraManager](#cameragetcameramanager)** is called, a camera
```js
async function getCameraInfo("cameraId") {
var cameraManager = await camera.getCameraManager();
var cameraManager = await camera.getCameraManager(context);
var cameras = await cameraManager.getCameras();
var cameraObj = cameras[0];
var cameraId = cameraObj.cameraId;
......@@ -2359,7 +2359,7 @@ Listens for frame shutter events. This API uses an asynchronous callback to retu
**Example**
```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);
})
......@@ -2383,7 +2383,7 @@ Listens for photo capture end events. This API uses an asynchronous callback to
**Example**
```js
photoOutput.on('captureEnd', (captureEndInfo) => {
photoOutput.on('captureEnd', (err, captureEndInfo) => {
console.log('photo capture end, captureId : ' + captureEndInfo.captureId);
console.log('frameCount : ' + captureEndInfo.frameCount);
})
......@@ -2407,7 +2407,7 @@ Listens for **PhotoOutput** errors. This API uses a callback to return the error
**Example**
```js
photoOutput.on('error', (photoOutputError) => {
photoOutput.on('error', (err, photoOutputError) => {
console.log('Photo output error code: ' + photoOutputError.code);
})
```
......
......@@ -347,7 +347,7 @@ cameraManager.on('cameraStatus', (err, cameraStatusInfo) => {
```js
async function getCameraInfo("cameraId") {
var cameraManager = await camera.getCameraManager();
var cameraManager = await camera.getCameraManager(context);
var cameras = await cameraManager.getCameras();
var cameraObj = cameras[0];
var cameraId = cameraObj.cameraId;
......@@ -2359,7 +2359,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);
})
......@@ -2383,7 +2383,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);
})
......@@ -2407,7 +2407,7 @@ on(type: 'error', callback: ErrorCallback<PhotoOutputError\>): void
**示例:**
```js
photoOutput.on('error', (photoOutputError) => {
photoOutput.on('error', (err, photoOutputError) => {
console.log('Photo output error code: ' + photoOutputError.code);
})
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册