Commit d5fea95f by yuananting

fix:题库录音调试(mac企微)

parent ed74e3ae
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-03-18 10:01:28 * @Date: 2020-03-18 10:01:28
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-06-09 14:44:01 * @LastEditTime: 2021-06-09 15:54:34
* @Description: 录音组件 * @Description: 录音组件
*/ */
...@@ -87,8 +87,18 @@ class XMRecord extends Component { ...@@ -87,8 +87,18 @@ class XMRecord extends Component {
handleStartRecord = () => { handleStartRecord = () => {
if(Platform.isWorkWx()) { // 企业微信 if(Platform.isWorkWx()) { // 企业微信
WechatApi.startRecord(); WechatApi.startRecord({
success: function (res) {
alert("开始录音", res)
this.mMediaRecorder = new AudioRecorder(res);
this.mMediaRecorder.start();
this.handleCountTime();
},
fail: function (res) {
alert("未开始录音", res)
} }
});
} else {
navigator.mediaDevices navigator.mediaDevices
.getUserMedia({ .getUserMedia({
audio: true, audio: true,
...@@ -98,6 +108,7 @@ class XMRecord extends Component { ...@@ -98,6 +108,7 @@ class XMRecord extends Component {
this.mMediaRecorder.start(); this.mMediaRecorder.start();
this.handleCountTime(); this.handleCountTime();
}, this.openDeviceFailure); }, this.openDeviceFailure);
}
}; };
onProcessData = (audioData) => { onProcessData = (audioData) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment