Google Chrome doesn't respect the autoplay
attribute on HTML5 <video>
elements. Using video.play()
JavaScript as soon as the page loads throws an error:
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
OK, but YouTube videos are HTML5 and they autoplay just fine. What technique does YouTube use to bypass Chrome's restriction? Are all webpages able to do the same (or no, maybe because YouTube has an exception since Google owns it)?