Page 1 of 1

Uncaught (in promise) DOMException: The play method ...

Posted: 18 February 2024, 20:20
by _Maestro_
Hi all,

I have a very annoying error... starting up my game or by pushing F5 every now and than my game hangs on the status "Updating game situation..." It happens on the same moment, but strangely enough not always.

The error given in the console:
Uncaught (in promise) DOMException: The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

This message is preceded by another message (in Dutch, so I translated it for you):
Autoplay is only allowed when approved by the user, the website is activated by the user, or media is muted.
This message has a link: ly_studio.js:1:790579

Going to this link I see the following part of the long text highlighted:
PlayFile:function(e){var t=this.getSoundTag(e);this.loadSound(e);if($(t)){$(t).volume=this.volume;$(t).currentTime=0;$(t).play()}},stop:function(e){var t=this.getSoundIdFromEvent(e.id),i=this.getSoundTag(t);$(i)&&$(i).pause()},onChangeSound:function(e){this.sounds[e.args.event]=e.args.file}})}))}

It seems like it wants to play a sound (which is not requested anywhere in my code) and somehow it is not allowed to play this sound.

Anyone knows what I can do to stop this issue?

Cheers
Maurice

Re: Uncaught (in promise) DOMException: The play method ...

Posted: 19 February 2024, 00:37
by robinzig
I think this "error" is standard and nothing to work about. This is what I always see in the console on Studio (it's not quite an identical error message to the one you quote, but similar enough to perhaps be caused by browser or language differences): "ly_studio.js:1 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first."

If your game is freezing on "updating game sitaution" that is likely to be a completely unrelated issue in your own code - most likely you are not handling a notification sent from your backend code.