Settings

Theme

Ask HN: How is YouTube able to autoplay videos with volume?

12 points by linuxdeveloper 2 years ago · 8 comments · 1 min read


How is YouTube the only site on the internet that is able to autoplay videos with volume?

I thought the browsers prevented that.

How are they doing this?

LinuxBender 2 years ago

How is YouTube the only site on the internet that is able to autoplay videos with volume?

They have a policy in Chrome [1]

Chrome does this by learning your preferences. If you don’t have browsing history, Chrome allows autoplay for over 1,000 sites where we see that the highest percentage of visitors play media with sound. As you browse the web, that list changes as Chrome learns and enables autoplay on sites where you play media with sound during most of your visits, and disables it on sites where you don’t. This way, Chrome gives you a personalized, predictable browsing experience.

[1] - https://stackoverflow.com/questions/59409015/how-can-youtube...

  • linuxdeveloperOP 2 years ago

    "This way, Chrome gives you a personalized, predictable browsing experience."

    Right... "predictable."

    • LinuxBender 2 years ago

      Yeah I would not like it if my browser did that either. There's probably a way to turn it off but I do not use Chrome so do not know.

ksherlock 2 years ago

Auto-play video with sound is allowed by browsers after you interact with a web page. Youtube is an SPA (you can tell because it often fucks up the back button) so when you click on video link, you're interacting and auto-play works. When you open in a new tab, it loads anew and won't auto-play because there hasn't been any interaction.

https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_...

tkiolp4 2 years ago

Google owns YouTube and Chrome. They can do whatever they want with any of them.

vhcr 2 years ago

It's not, Firefox works perfectly and blocks it from autoplaying.

remyp 2 years ago

It's even more fun in Safari on MacOS. Videos don't autoplay, but they also don't play when you DO hit the play button.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection