|
|
@@ -215,31 +215,43 @@ export default {
|
|
|
},
|
|
|
stopRecord() {
|
|
|
console.log("测试测试")
|
|
|
+ alert("点击停止录音1")
|
|
|
if (new Date().getTime() - this.recordObj.startTime < 2000) {
|
|
|
+ alert("点击停止录音2")
|
|
|
return this.$message.info(this.lang.ssRecordShort)
|
|
|
}
|
|
|
+ alert("点击停止录音3")
|
|
|
const iframe = this.$refs["iframeRef"];
|
|
|
// 判断浏览器是否有开启录音权限
|
|
|
navigator.permissions && navigator.permissions.query({ name: 'microphone' }).then(permissionStatus => {
|
|
|
+ alert("点击停止录音4")
|
|
|
if (permissionStatus.state !== "granted") {
|
|
|
// 没有开启录音权限,直接确定停止录音
|
|
|
+ alert("点击停止录音5")
|
|
|
this.recordObj.status = "0";
|
|
|
this.recordObj.loading = false;
|
|
|
+
|
|
|
this._cleanupTranscriber(iframe);
|
|
|
+ alert("点击停止录音6")
|
|
|
this.$message.success(this.lang.ssNoPermStop);
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
console.log("测试测试222")
|
|
|
// 有权限再判断状态
|
|
|
+ alert("点击停止录音7")
|
|
|
try {
|
|
|
if (this.recordObj.status == '1' && !this.recordObj.loading) {
|
|
|
+ alert("点击停止录音8")
|
|
|
console.log("测试测3333")
|
|
|
this.recordObj.loading = true;
|
|
|
iframe.contentWindow.window.document
|
|
|
.getElementById("scenarioStopButton")
|
|
|
.click();
|
|
|
+ alert("点击停止录音9")
|
|
|
iframe.contentWindow.onSessionStopped = (s, e) => {
|
|
|
try {
|
|
|
+ alert("点击停止录音10")
|
|
|
this.recordObj.status = "0"
|
|
|
this.recordObj.loading = false;
|
|
|
this.$message.success(this.lang.ssStoppedRec)
|
|
|
@@ -250,6 +262,7 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
} else {
|
|
|
+ alert("点击停止录音11")
|
|
|
this.recordObj.status = "0";
|
|
|
this.recordObj.loading = false;
|
|
|
this._cleanupTranscriber(iframe);
|
|
|
@@ -267,6 +280,7 @@ export default {
|
|
|
this._cleanupTranscriber(this.$refs["iframeRef"]);
|
|
|
this.$message.success(this.lang.ssMicCheckStop);
|
|
|
});
|
|
|
+ alert("点击停止录音end")
|
|
|
},
|
|
|
setWork() {
|
|
|
this.work = JSON.parse(JSON.stringify(this.workData.json));
|