I have a ticket booking website. When a ticket is ready to be served, a modal should open, and a sound should play along with the ticket information. I want the sound to play without requiring user interaction to provide a better user experience.
The website has two pages: one is the login page and the other is the ticket serving list. When a user enters the website step by step, first logging in and then navigating to the ticket serving page, the user interaction condition is fulfilled, and the audio plays with sound. However, there is one caveat: when I’m on the ticket serving page and refresh, the user interaction memory is reset, so the user has to click somewhere again. I want to play the audio with sound without requiring user interaction to improve the website experience.
According to the Chrome autoplay documentation, it is mentioned that top frames can delegate autoplay permissions to their iframes to allow autoplay with sound.
Does anyone have an idea of how to implement this?
I tried iframe delegation but did not get success till now.