Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

And thank whatever deity you may or may not believe in that this changed. Yes, it sucks for these traditional websites, but advertisers abused it so much it hurt.


Indeed. The end of autoplay being on by default or not being a setting at all is a blessing far more than anyone worth their salt has even thought it could be a curse.


Shouldn't it be possible to still achieve auto-play using JavaScript? It's just a tiny bit more effort. :)


No, the browser checks the call stack of the javascript function. If the play() isn't a direct result of some kind of user interaction. It will just deny you from playing audio.

So play upon you open the page is no longer possible. You at least need to wait for the user to touch somewhere on the page.


Yeah there's all sorts of nonsense you can do to do autoplay. I kind of remember at one of my old jobs, to get autoplay working on some elearning courses, when the user clicked 'Start', we'd start the audio but not play anything, and then switch out the file that was played when required which would 'autoplay' as the user had already initiated the sound. At least that was the general idea afaik.


Only works well on single-page applications. A much more insidious strategy is to bind to the "Accept cookies" button.


and now all we need to do is the same for video...


Video does the same thing, except you can autoplay it if it's muted.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: