Commit 6205fd05 authored by liujiangnan's avatar liujiangnan

fix

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