User283571144 posted
Hi ngaisteve,
According to your description and codes, I have created a test demo on my side, it works well.
I guess you may use chrome as the browser. As far as I know, the Chrome has the autoplay policy to disable autoplay.
I suggest you could follow below steps to enable the autoplay when page loaded.
First step, enter chrome://flags/#autoplay-policy in Chrome browser.
The second step is to change Default to No user gesture is required in Autoplay policy.
The third step, click on the "RELAUNCH NOW" below, and you're done!
Best Regards,
Brando