Skip to content

Commit 9334b98

Browse files
authored
Merge pull request #8 from zhangmengjia/sig
fix:修复录制暂停,再继续录制状态刷新问题
2 parents 8275d0a + 78bc820 commit 9334b98

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Recorder.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ class Recorder extends EventEmitter {
9494
if (this._state === MediaStates.IDLE) {
9595
tasks.push((next) => {
9696
this.prepare((err, fsPath) => {
97-
if(Platform.OS === 'harmony'){
98-
if(fsPath){
97+
if (Platform.OS === 'harmony') {
98+
if (fsPath) {
9999
this._updateState(err, MediaStates.RECORDING);
100100
callback(err, fsPath);
101-
}else{
101+
} else {
102102
this._updateState(err, MediaStates.IDLE);
103103
callback(err, null);
104104
}
@@ -111,11 +111,15 @@ class Recorder extends EventEmitter {
111111
RCTAudioRecorder.record(this._recorderId, next);
112112
});
113113
async.series(tasks, (err) => {
114-
if(Platform.OS !== 'harmony'){
114+
if (Platform.OS !== 'harmony') {
115+
this._updateState(err, MediaStates.RECORDING);
116+
callback(err);
117+
return;
118+
}
119+
if (this._state === MediaStates.PAUSED) {
115120
this._updateState(err, MediaStates.RECORDING);
116121
callback(err);
117122
}
118-
119123
});
120124
return this;
121125
}

0 commit comments

Comments
 (0)