Commit bba74941 authored by limingzhe's avatar limingzhe

update preload audio

parent ed63dcea
...@@ -140,13 +140,15 @@ export class Cartoon { ...@@ -140,13 +140,15 @@ export class Cartoon {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const audio = new Audio(); const audio = new Audio();
audio.oncanplay = a => { audio.oncanplay = a => {
resolve(audio); // resolve(audio);
}; };
audio.onerror = () => { audio.onerror = () => {
reject(); reject();
}; };
audio.src = url; audio.src = url;
audio.load(); audio.load();
resolve(audio);
}); });
} }
...@@ -249,4 +251,4 @@ export class Cartoon { ...@@ -249,4 +251,4 @@ export class Cartoon {
} }
animation = new CartoonAnimation(this) animation = new CartoonAnimation(this)
} }
\ No newline at end of file
...@@ -687,10 +687,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -687,10 +687,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initGroup(); this.initGroup();
if(this.g_teacherFlag){ if(this.g_teacherFlag){
this.initStartButton() this.initStartButton()
this.initTeacherListener() // this.initTeacherListener()
}else{ }else{
this.initCover() this.initCover()
this.initStudentListener(); // this.initStudentListener();
} }
} }
...@@ -1987,6 +1987,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1987,6 +1987,12 @@ export class PlayComponent implements OnInit, OnDestroy {
this.update(); this.update();
this.systemReady(); this.systemReady();
if(this.g_teacherFlag){
this.initTeacherListener()
}else{
this.initStudentListener();
}
window["air"].hideAirClassLoading(this.g_KEY, this.g_data); window["air"].hideAirClassLoading(this.g_KEY, this.g_data);
}); });
......
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