I need to Use audio sound on new requests based on business logic. when I call "playAudio()" this function in Page Load Means NgOninit It's not working. it giving me the below error.
prescan-orderlist.component.ts:116 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
I search for that but based on crome new policy they have restricted.
Please help me if you have any idea to achieve this.
public playAudio() {
let audio = new Audio();
audio.src = "../assets/images/beep.wav";
audio.load();
audio.play();
}