Hi everyone. Under recent Google Chrome version (for instance 67.0.3396.99 (Official Build) (64-bit) it is not possible to play a video immediately after the program is started (that means the ‘index.html’ file and .js are loaded into browser). The browser throws the following exception with an autoplaying video:
Uncaught (in promise) DOMException: play() failed because the user didn’t interact with the document first. https://goo.gl/xX8pDD p5.dom.js:1711
The problem concerns not only p5.js and dom.js but HTML5 more generally:
It can be solved changing the following Chrome policy:
The default auto-play policy value is apparently set to: “User gesture is required for cross origins iframes”. Setting it to “No user gesture is required” solves the problem in Chrome.
But apparently it would also be possible to solve it within HTML changing elements attributes…
It’s not really elegant to ask user to change a browser policy in order for an htm5 application to work… Is there a way to solve the problem directly within a sketch?
Thanks a lot for insights!