Fix more issue with audioTimer

This commit is contained in:
Chrystian Huot 2019-08-29 14:41:29 -04:00
parent eba36f732c
commit b8acccfccc

View file

@ -243,7 +243,7 @@ export class AppRadioService implements OnDestroy {
EVENTS.forEach((event) => document.body.addEventListener(event, resume)); EVENTS.forEach((event) => document.body.addEventListener(event, resume));
} }
this.startAudioTimer(); this.resetAudioTimer();
}, (error: Error) => { }, (error: Error) => {
this.skip(true); this.skip(true);
@ -462,6 +462,11 @@ export class AppRadioService implements OnDestroy {
} }
} }
private resetAudioTimer(): void {
this.stopAudioTimer();
this.startAudioTimer();
}
private startAudioTimer(): void { private startAudioTimer(): void {
if (this.audioTimer === null) { if (this.audioTimer === null) {
this.emitTimeEvent(); this.emitTimeEvent();