Commit c5965d70 authored by limingzhe's avatar limingzhe

fix: 直播一次 移动端 音效

parent c210d69c
......@@ -142,7 +142,9 @@ export class PlayComponent implements OnInit, OnDestroy {
// await loadFonts();
await loadFonts('DroidSansFallback', 'DroidSansFallback.ttf');
await loadFonts('Aileron-Black', 'Aileron-Black.ttf');
await loadFonts('Aileron-Bold', 'Aileron-Bold.ttf');
const getData = (<any>window).courseware.getData;
getData((data, aspect) => {
......@@ -446,18 +448,10 @@ export class PlayComponent implements OnInit, OnDestroy {
this.loadResources().then(() => {
// this.setfontData();
console.log('aaaaaa');
loadFonts('DroidSansFallback', 'DroidSansFallback.ttf').then( () => {
console.log('bbbbb');
loadFonts('Aileron-Black', 'Aileron-Black.ttf').then( () => {
console.log('cccc');
this.addServerListener();
window['air'].hideAirClassLoading(this.KEY, this.data);
this.addServerListener();
window['air'].hideAirClassLoading(this.KEY, this.data);
})
})
});
......@@ -2079,17 +2073,23 @@ export class PlayComponent implements OnInit, OnDestroy {
const audio = this.audioObj[key];
if (audio) {
if (now) {
audio.pause();
audio.currentTime = 0;
}
if (callback) {
audio.onended = () => {
callback();
};
}
audio.play();
const audioNew = new Audio();
audioNew.src = audio.src;
audioNew.load();
audioNew.play();
// if (now) {
// audio.pause();
// audio.currentTime = 0;
// }
// if (callback) {
// audio.onended = () => {
// callback();
// };
// }
// audio.play();
}
}
......
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