Commit 6205fd05 authored by liujiangnan's avatar liujiangnan

fix

parent 41d806ef
......@@ -69,6 +69,8 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
window['courseware'].onEvent('course-in-screen', () => {
setTimeout(() => {
this.audio = new Audio();
this.audio.src = this.data.contentObj.audio_id;
this.canPlayAudio = true;
}, 1500);
});
......@@ -126,7 +128,6 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
return;
}
ev.preventDefault();
console.log('Trying to play audio...', window['air'].isCourseInScreen);
if (this.data.contentObj && this.data.contentObj.audio_id) {
if (this.audio && !this.audio.paused) {
console.log('Pausing audio...');
......@@ -134,9 +135,6 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
this.changeDetectorRef.markForCheck();
return;
}
this.audio = new Audio();
this.audio.src = this.data.contentObj.audio_id;
this.audio.play();
this.changeDetectorRef.markForCheck();
} else {
......
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