Why is an error raised within the SL app running on Android | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

Why is an error raised within the SL app running on Android

The code referenced below runs well in the browser on both a pc and the Android device using Chrome and Firefox but shows an error in the SL app of 'Uncaught (in promise) NotAllowedError: play can only be initiated by a user gesture. Line 320.' Can anyone tell me why this is happening and how it can be avoided. The code has been made private for the time being since so many people appear to use the SL app and I would like to solve the problem before making it public again. The code can be seen at: https://code.sololearn.com/WMSWeV7ATN7D/#html

11th May 2018, 6:43 PM
Richard Myatt
Richard Myatt - avatar
2 Answers
+ 5
Thank you for your response Brains. Pressing the start button, in this case, is the user gesture which starts the game and the sound sequence but instead raises the error for what appears to be the first move only and this is what is confusing me at the moment. My thanks again.
12th May 2018, 9:47 AM
Richard Myatt
Richard Myatt - avatar
+ 4
You cannot play audios automatically.You need a gesture from the user,like a click,a touchmove,a devicetilt or something
11th May 2018, 8:37 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar