How could i add a background Audio For a timer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How could i add a background Audio For a timer

i would like to add a ticking sound that i have in my audio tag play automatically and loop once timer is set and once ended I would like to play another sound like an alert,It works well with buttons actually but wen i do a normal function call it returns uncaught promise Play() cant be initiated without user gestures https://code.sololearn.com/W6P4Qw5RWe0j/?ref=app

11th Nov 2017, 2:04 PM
MohanPierce
MohanPierce - avatar
2 Answers
+ 3
change your browser. normally modern browsers does not allow you to run javascripts like those without user permission.
11th Nov 2017, 2:30 PM
Asiri H
Asiri H - avatar
+ 1
Well Is tre any posibility that i could run it on sololearns browser the point of this question is it even possible to run background audios without User initiated events?
11th Nov 2017, 3:23 PM
MohanPierce
MohanPierce - avatar