I am facing an issue where the beep sound trigger upon receiving an API response works perfectly in Chrome and Firefox browsers, but unfortunately, it does not work in Internet Explorer.
if ($scope.totalQueueList) {
var audio = new Audio();
audio.src = 'rest/assets/images/beep.mp3';
audio.oncanplaythrough = (event) => {
var playedPromise = audio.play();
if (playedPromise) {
playedPromise.catch((e) => {
console.log(e)
if (e.name === 'NotAllowedError' || e.name === 'NotSupportedError') {
console.log(e.name);
}
}).then(() => {
});
}
}
}
I am seeking assistance on how to make this functionality compatible with Internet Explorer. Can anyone help me resolve this?