|
@@ -607,7 +607,11 @@ export default {
|
|
|
this.playSentIndex = 0;
|
|
|
}
|
|
|
}
|
|
|
- this.handleChangeTime(this.resArr.timeList[this.playSentIndex].s);
|
|
|
+ this.handleChangeTime(
|
|
|
+ this.resArr.timeList[this.playSentIndex]
|
|
|
+ ? this.resArr.timeList[this.playSentIndex].s
|
|
|
+ : null
|
|
|
+ );
|
|
|
},
|
|
|
getCurTime(curTime) {
|
|
|
if (this.isCompare) {
|
|
@@ -697,10 +701,15 @@ export default {
|
|
|
wordlist.push(obj);
|
|
|
});
|
|
|
resArr.wordsList.push(wordlist);
|
|
|
- resArr.timeList.push(articleInfo.art_sound_srt_data.sents[index]);
|
|
|
+ if (
|
|
|
+ articleInfo.art_sound_srt_data &&
|
|
|
+ articleInfo.art_sound_srt_data.sents &&
|
|
|
+ articleInfo.art_sound_srt_data.sents[index]
|
|
|
+ ) {
|
|
|
+ resArr.timeList.push(articleInfo.art_sound_srt_data.sents[index]);
|
|
|
+ }
|
|
|
});
|
|
|
this.resArr = resArr;
|
|
|
- console.log(this.resArr);
|
|
|
},
|
|
|
handleChangeTime(time, ed, flag, type) {
|
|
|
this.audio.pause();
|
|
@@ -730,7 +739,8 @@ export default {
|
|
|
} else {
|
|
|
this.ed = undefined;
|
|
|
}
|
|
|
- this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
|
|
|
+ if (this.$refs.audioLine)
|
|
|
+ this.$refs.audioLine.onTimeupdateTime(time / 1000, true);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -762,7 +772,7 @@ export default {
|
|
|
let _this = this;
|
|
|
this.audio.pause();
|
|
|
this.audioc.pause();
|
|
|
- if (_this.$refs.audioLine.audio.playing) {
|
|
|
+ if (_this.$refs.audioLine && _this.$refs.audioLine.audio.playing) {
|
|
|
_this.$refs.audioLine.PlayAudio();
|
|
|
}
|
|
|
if (!this.microphoneStatus) {
|
|
@@ -974,10 +984,13 @@ export default {
|
|
|
} else {
|
|
|
_this.audioc.pause();
|
|
|
_this.audioc.load();
|
|
|
- _this.handleChangeTime(
|
|
|
- _this.resArr.timeList[playSentIndex].s,
|
|
|
- _this.resArr.timeList[playSentIndex].e
|
|
|
- );
|
|
|
+ if (_this.resArr.timeList[playSentIndex]) {
|
|
|
+ _this.handleChangeTime(
|
|
|
+ _this.resArr.timeList[playSentIndex].s,
|
|
|
+ _this.resArr.timeList[playSentIndex].e
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
_this.timeC = setInterval(() => {
|
|
|
if (_this.curTime >= _this.resArr.timeList[playSentIndex].e - 250) {
|
|
|
_this.curTime = _this.resArr.timeList[playSentIndex].s;
|