Commit 746747f8 authored by Jeff nan's avatar Jeff nan

debug

parent 11aaf94d
......@@ -62,7 +62,9 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges {
window['courseware'].onEvent('course-in-screen', () => {
setTimeout(() => {
this.audio = new Audio();
this.audio.src = this.data.contentObj.audio_id;
if (this.data.contentObj && this.data.contentObj.audio_id) {
this.audio.src = this.data.contentObj.audio_id;
}
this.rightAudio = new Audio();
this.rightAudio.src = 'assets/right.mp3';
this.wrongAudio = new Audio();
......@@ -81,12 +83,12 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges {
this._data = _.get(this.data.contentObj, 'pics', []).filter(item => item && item.pic_id);
this._data.forEach(item => item.state = 'none');
this._lc_text = '';
if (this.data.contentObj && this.data.contentObj.audio_id) {
this.audio.src = this.data.contentObj.audio_id;
this.audio.load();
}
this.audio.pause();
this.audio.currentTime = 0;
// if (this.data.contentObj && this.data.contentObj.audio_id) {
// this.audio.src = this.data.contentObj.audio_id;
// this.audio.load();
// }
// this.audio.pause();
// this.audio.currentTime = 0;
this.isPlaying = false;
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
......
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