I have an alert system web app, where if a new alert shows up, the app plays sound. But since there is this Autoplay Policy, the user must interact with a page first if I want to play an audio on a page. I read a lot of SO questions about this issue, like this, but what I want is to store let say in local storage
if user already interacted with page and play the audio automatically if he is a returning user. Since my users opens my web app frequently, they dont want to click on a button every time to allow playing notifications. Any idea how to achieve that?
Asked
Active
Viewed 105 times
2

Runtime Terror
- 6,242
- 11
- 50
- 90
-
A user can create a launcher which runs the program with appropriate flags or policy set to disable default browser policy. – guest271314 Feb 01 '19 at 07:23
1 Answers
1
You need https connection for it. when users grant the permission once, its save and not ask again for that page. for more check https://www.html5rocks.com/en/tutorials/getusermedia/intro/

Usama Kiyani
- 195
- 10
-
That looks to address audio and video *input*, not *output*, which is entirely different. I can't remember *ever* having seen an audio permission request in Chrome or FF. – CertainPerformance Feb 01 '19 at 06:59
-
If the permissions are not required then program your sound to auto play or when you want to play. – Usama Kiyani Feb 01 '19 at 07:03
-
Permissions *are* required, but IIRC it's always granted *implicitly*, via user interaction. Without user interaction, an error will be thrown - thus this question, the process seems very inconvenient. – CertainPerformance Feb 01 '19 at 07:04
-
This means that your browser don't save that permission state. try it with https then. – Usama Kiyani Feb 01 '19 at 07:08
-
I remember running into this problem *on* HTTPS. I don't think HTTPS does anything here. – CertainPerformance Feb 01 '19 at 07:12
-