|
@@ -89,8 +89,6 @@ export default {
|
|
|
let re;
|
|
|
if (/<a.*?question-audio.*?\/a>/.test(this.questionBody)) {
|
|
|
re = /name="([^"]*)".*?question-audio.*?url="([^"]*)"/g;
|
|
|
- } else {
|
|
|
- re = /name="([^"]*)".*?url="([^"]*)"/g;
|
|
|
}
|
|
|
let array1;
|
|
|
while ((array1 = re.exec(this.questionBody)) !== null) {
|
|
@@ -146,17 +144,18 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
audioEnded(name) {
|
|
|
- this.audioInPlay.delete(name);
|
|
|
+ this.audioInPlay = new Set(this.audioInPlay).delete(name);
|
|
|
},
|
|
|
played(index, $event) {
|
|
|
+ const name = $event.target.attributes.name.value;
|
|
|
if (!this.examQuestion.limitedPlayTimes) {
|
|
|
+ this.audioInPlay = new Set(this.audioInPlay).add(name);
|
|
|
// 如果没有设置音频播放次数
|
|
|
- this.audioInPlay.add(name);
|
|
|
return false;
|
|
|
}
|
|
|
const limitedPlayTimes = this.examQuestion.limitedPlayTimes;
|
|
|
console.log("开始播放");
|
|
|
- const name = $event.target.attributes.name.value;
|
|
|
+
|
|
|
// console.log(name);
|
|
|
const theAudio = this.allAudioPlayTimes.find(a => a.name === name);
|
|
|
const playedTimes = (theAudio || { times: 0 }).times;
|
|
@@ -165,7 +164,7 @@ export default {
|
|
|
$event.target.pause();
|
|
|
return;
|
|
|
}
|
|
|
- this.audioInPlay.add(name);
|
|
|
+ this.audioInPlay = new Set(this.audioInPlay).add(name);
|
|
|
|
|
|
// var audio = new Audio($event.target.src);
|
|
|
// audio.play();
|