Commit 166e3291 authored by Chen Jiping's avatar Chen Jiping

fix:修复音频材料播放

parent 569cbdd4
......@@ -360,7 +360,7 @@ export class PlayComponent implements OnInit, OnDestroy {
return new Promise((resolve, reject) => {
const audio = new Audio();
audio.oncanplay = (a) => {
resolve();
resolve(a);
};
audio.onerror = () => {
reject();
......@@ -615,16 +615,15 @@ export class PlayComponent implements OnInit, OnDestroy {
this.bgAudio.pause();
}
this.bgAudio = this.playAudio(this.curExercises.audio_url, true);
this.timeId = setTimeout(() => {
if (!this.finished) {
this.playBgAudio();
}
}, 3000);
this.bgAudio = this.playAudio(this.curExercises.audio_url, true, () =>{
this.timeId = setTimeout(() => {
if (!this.finished) {
this.playBgAudio();
}
}, 3000);
});
}
......
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