Commit 0f9bc270 authored by Chen Jiping's avatar Chen Jiping

fix:调整题干音频播放问题;调整正确和答案音频重叠问题

parent 0d999088
......@@ -203,7 +203,7 @@ export class AudioAnimation {
* @param audio 播放音频
* @param callback
*/
playAudio(audio, callback = null) {
playAudio(audio, reset = true, callback = null) {
//console.log(audio);
if (!audio) {
return;
......@@ -211,6 +211,10 @@ export class AudioAnimation {
this.curAudio = audio;
if (reset) {
this.curAudio.currentTime = 0;
}
audio.onended = () => {
this.playing = false;
......
......@@ -1048,11 +1048,13 @@ export class PlayComponent implements OnInit, OnDestroy {
if (card.curAnswer.isRight == '1') {
this.playAudio('right', true);
this.playAudio('right', true, () => {
this.playAudio(card.curAnswer.audioUrl, true);
});
card.curAnswer.endFlag = true;
this.playAudio(card.curAnswer.audioUrl, true);
} else {
this.playAudio('wrong', true);
}
......
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