Page 1 of 1

Question about tutorial animation

Posted: 31 July 2020, 04:44
by HumanBot
So I'm having trouble with the last section of the Reversi tutorial. Basically, there's this one section that will fadeout, then fadein the target token twice and they use the dojo framework to do it. However, this is being done inside the "notif_turnOverDiscs" function. I end up getting a "Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first." I feel like if this is the case, we shouldn't be calling .play() inside of a notification because it's not activating the function directly after a user interaction? I did some looking around online and it seems this has to do with Chrome's 2018 change to block autoplay on webpages?

Just want to know what I should be doing in this case because the sample Reversi code they give us does this still so I'm not sure if this is just outdated or if I should be adding a line somewhere.

Re: Question about tutorial animation

Posted: 31 July 2020, 20:32
by Kellbot
Are you seeing anything else noteworthy in the console log? When I was getting that error it was because another javascript method I'd written was misbehaving.

Re: Question about tutorial animation

Posted: 31 July 2020, 20:59
by RicardoRix
I get 14 of these error messages on a page reload. I don't seem to get any during notifications though. I don't think they stop anything happening.

Re: Question about tutorial animation

Posted: 01 August 2020, 08:11
by Brainchild
I get these in my project and I've seen them in others. I don't think they cause any harm.

Re: Question about tutorial animation

Posted: 03 August 2020, 20:34
by HumanBot
Oh yeah I realize it happened because I was accessing an empty element with the fadein/fadeout call. Not sure why that causes the problem, but I fixed that and the error doesnt show up anymore. Thanks for the replies.