Use an empty audio stream to reset audio server

This commit is contained in:
Chrystian Huot 2019-07-10 07:54:21 -04:00
parent 8a80d0f2c6
commit 798fae505e

View file

@ -240,7 +240,7 @@ export class AppRadioService implements OnDestroy {
stop(): void {
if (this._call.current) {
this._audio.src = 'data:audio/aac;base64,//FsQAOf/N4CAExhdmM1OC4zNS4xMDAAAjBADv/xbEADn/zeAgBMYXZjNTguMzUuMTAwAAIwQA4=';
this._audio.src = this._getEmptyAudioStream();
this._call.previous = this._call.current;
this._call.current = null;
@ -329,7 +329,7 @@ export class AppRadioService implements OnDestroy {
}
};
this._audio = new Audio();
this._audio = new Audio(this._getEmptyAudioStream());
this._audio.autoplay = true;
@ -390,6 +390,10 @@ export class AppRadioService implements OnDestroy {
this._emitQueueEvent();
}
private _getEmptyAudioStream(): string {
return 'data:audio/aac;base64,//FsQAOf/N4CAExhdmM1OC4zNS4xMDAAAjBADv/xbEADn/zeAgBMYXZjNTguMzUuMTAwAAIwQA4=';
}
private _readAvoids(): void {
const avoids = this._readLocalStorage(LOCAL_STORAGE_KEY.avoids);