I tried to play the audio when we are in the different chrome tab but i could't able to hear the sound. It was happening for the first time when i load my page. While playing that sound if i switched to the respective tab then i can able to hear the sound. After that i can able to hear the sound in the different tab whenever audio was playing.
Example code:
const audioElement = new Audio('car_horn.wav');
audioElement.play() //returning promise object.
here if we play the sound from different tab the promise object state was pending instead of fullfilled. When we switched to the respective tab it will changed as fullfilled instantly. First time only this issue was happening in the chrome tab. Can anyone provide any solution for this issue.