Safari doesnt support promise version of decodeAudioData

This commit is contained in:
Chrystian Huot 2019-08-30 10:42:33 -04:00
parent 97399ba4c9
commit 841b7eee21

View file

@ -224,7 +224,7 @@ export class AppRadioService implements OnDestroy {
arrayBufferView[i] = audio.charCodeAt(i); arrayBufferView[i] = audio.charCodeAt(i);
} }
this.audioContext.decodeAudioData(arrayBuffer).then((buffer) => { this.audioContext.decodeAudioData(arrayBuffer, (buffer) => {
if (this.call.current) { if (this.call.current) {
this.audioSource = this.audioContext.createBufferSource(); this.audioSource = this.audioContext.createBufferSource();
@ -249,7 +249,7 @@ export class AppRadioService implements OnDestroy {
EVENTS.forEach((event) => document.body.addEventListener(event, resume)); EVENTS.forEach((event) => document.body.addEventListener(event, resume));
} }
} }
}).catch(() => this.skip(true)); }, () => this.skip(true));
} }
} }
} }