提交 c814dcaa 编写于 作者: B bird_j

modyfied bugs

Signed-off-by: Nbird_j <jianghongpeng@huawei.com>
上级 3fb6c598
......@@ -39,7 +39,7 @@
包含流程:创建实例,设置录制参数,录制音频,暂停录制,恢复录制,停止录制,释放资源等流程。
```js
funfunction SetCallBack(audioRecorder) {
function SetCallBack(audioRecorder) {
audioRecorder.on('prepare', () => { // 设置'prepare'事件回调
console.log('prepare success');
// 录制界面可切换至已准备好,可点击录制按钮进行录制
......@@ -87,7 +87,7 @@ let audioRecorderConfig = {
uri : 'file:///data/accounts/account_0/appdata/appdata/recorder/test.m4a', // 文件需先由调用者创建,并给予适当的权限
location : { latitude : 30, longitude : 130},
}
audioRecorder.prepare(audioRecorderConfig)
audioRecorder.prepare(audioRecorderConfig);
// 4.开始录制
audioRecorder.start(); // 需等待'prepare'事件回调完成后,才可调用start进行录制,触发'start'事件回调
// 5.暂停录制
......
......@@ -1078,18 +1078,12 @@ getInputSurface(callback: AsyncCallback\<string>): void;
```js
// asyncallback
let surfaceId = null;
let events = require('events');
let eventEmitter = new events.EventEmitter();
eventEmitter.on('getInputSurface', () => {
videoRecorder.getInputSurface((err, surfaceId) => {
videoRecorder.getInputSurface((err, surfaceId) => {
if (typeof (err) == 'undefined') {
console.info('getInputSurface success');
} else {
console.info('getInputSurface failed and error is ' + err.message);
}
});
});
```
......@@ -1113,7 +1107,6 @@ getInputSurface(): Promise\<string>;
```js
// promise
let surfaceId = null;
await videoRecorder.getInputSurface().then((surface) => {
console.info('getInputSurface success');
surfaceId = surface;
......@@ -1142,17 +1135,12 @@ start(callback: AsyncCallback\<void>): void;
```js
// asyncallback
let events = require('events');
let eventEmitter = new events.EventEmitter();
eventEmitter.on('start', () => {
videoRecorder.start((err) => {
videoRecorder.start((err) => {
if (typeof (err) == 'undefined') {
console.info('start videorecorder success');
} else {
console.info('start videorecorder failed and error is ' + err.message);
}
});
});
```
......@@ -1201,17 +1189,12 @@ pause(callback: AsyncCallback\<void>): void;
```js
// asyncallback
let events = require('events');
let eventEmitter = new events.EventEmitter();
eventEmitter.on('pause', () => {
videoRecorder.pause((err) => {
videoRecorder.pause((err) => {
if (typeof (err) == 'undefined') {
console.info('pause videorecorder success');
} else {
console.info('pause videorecorder failed and error is ' + err.message);
}
});
});
```
......@@ -1258,17 +1241,12 @@ resume(callback: AsyncCallback\<void>): void;
```js
// asyncallback
let events = require('events');
let eventEmitter = new events.EventEmitter();
eventEmitter.on('resume', () => {
videoRecorder.resume((err) => {
videoRecorder.resume((err) => {
if (typeof (err) == 'undefined') {
console.info('resume videorecorder success');
} else {
console.info('resume videorecorder failed and error is ' + err.message);
}
});
});
```
......@@ -1315,17 +1293,12 @@ stop(callback: AsyncCallback\<void>): void;
```js
// asyncallback
let events = require('events');
let eventEmitter = new events.EventEmitter();
eventEmitter.on('stop', () => {
videoRecorder.stop((err) => {
videoRecorder.stop((err) => {
if (typeof (err) == 'undefined') {
console.info('stop videorecorder success');
} else {
console.info('stop videorecorder failed and error is ' + err.message);
}
});
});
```
......@@ -1372,17 +1345,12 @@ release(callback: AsyncCallback\<void>): void;
```js
// asyncallback
let events = require('events');
let eventEmitter = new events.EventEmitter();
eventEmitter.on('release', () => {
videoRecorder.release((err) => {
videoRecorder.release((err) => {
if (typeof (err) == 'undefined') {
console.info('release videorecorder success');
} else {
console.info('release videorecorder failed and error is ' + err.message);
}
});
});
```
......@@ -1429,17 +1397,12 @@ reset(callback: AsyncCallback\<void>): void;
```js
// asyncallback
let events = require('events');
let eventEmitter = new events.EventEmitter();
eventEmitter.on('reset', () => {
videoRecorder.reset((err) => {
videoRecorder.reset((err) => {
if (typeof (err) == 'undefined') {
console.info('reset videorecorder success');
} else {
console.info('reset videorecorder failed and error is ' + err.message);
}
});
});
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册