Commit daf8bf4d authored by Li Mingzhe's avatar Li Mingzhe

feat: 优化音频卡住

parent 786a04a9
......@@ -212,6 +212,7 @@ export class PlayComponent implements OnInit, OnDestroy {
showPetalFlag;
bg;
delayPicSoundShowTime = 700;
......@@ -335,6 +336,9 @@ export class PlayComponent implements OnInit, OnDestroy {
const contentObj = this.data.contentObj;
if (!contentObj) { return; }
const picArr = contentObj.picArr;
console.log(' this.data: ', this.data);
// const addAudio = (key) => {
......@@ -347,10 +351,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// }
// }
//
// for (let i = 0; i < 4; i ++) {
// const key = i + '_audio_url';
// addAudio(key);
// }
//
// addAudio('audio_url');
//
......@@ -366,13 +367,13 @@ export class PlayComponent implements OnInit, OnDestroy {
audio.load();
this.audioObj[audioUrl] = audio;
}
};
const arr = contentObj.picArr;
if (arr) {
console.log('arr: ', arr);
for (let i = 0; i < arr.length; i++) {
addUrlToAudioObj(arr[i].audio_url);
}
......@@ -2046,7 +2047,6 @@ export class PlayComponent implements OnInit, OnDestroy {
}
showPicSound() {
this.canTouch = false;
......@@ -2067,13 +2067,17 @@ export class PlayComponent implements OnInit, OnDestroy {
audio.onended = () => {
setTimeout(() => {
this.showPicSound();
}, 0.7 * 1000);
}, this.delayPicSoundShowTime);
};
audio.play();
this.answerIdIndex ++;
} else {
this.showPicSound();
}
this.answerIdIndex ++;
}
......
......@@ -9,6 +9,10 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
<script type="text/javascript" src="http://teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air.js"></script>
<script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
<script>
var vConsole = new VConsole();
</script>
</head>
<body>
<app-root></app-root>
......
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