录制提示优化
This commit is contained in:
parent
18e9e1bbb0
commit
e063a825b5
|
|
@ -213,11 +213,21 @@ const agora = {
|
|||
iMediaRecorder.setMediaRecorderObserver({
|
||||
// 录制状态发生改变回调。
|
||||
onRecorderStateChanged: (channelId: any, uid: any, state: any, reason: any) => {
|
||||
console.log(channelId, uid, state, reason, '录制状态发生改变回调。');
|
||||
switch (reason) {
|
||||
case 1:
|
||||
message.error('录制文件写入失败')
|
||||
break;
|
||||
case 2:
|
||||
message.error('没有可录制的音视频流或者录制的音视频流中断超过 5 秒')
|
||||
break;
|
||||
case 3:
|
||||
message.error('录制时长超出上限')
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 录制信息更新回调。
|
||||
onRecorderInfoUpdated: (channelId: any, uid: any, info: any) => {
|
||||
console.log(channelId, uid, info, '录制信息更新回调。');
|
||||
message.success(`文件已保存至${info.fileName}`)
|
||||
},
|
||||
})
|
||||
iMediaRecorder.startRecording({
|
||||
|
|
|
|||
Loading…
Reference in New Issue