browser autoplay policy. How does autoplay work in Netflix?
Asked Answered
J

1

7

I've developed an application like netflix which streams video. I'm working with video.js.

when I try to play unmuted video, it throw error says that "Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https:// goo.gl/xX8pDD"

I can understand what the policy is, but I wonder how autoplay works in Netflix.

Video Preview on netflix works with sound well on chrome and safari. as soon as I access the video chat page in Netflix party, it turns to play with sound.

I wanna know what they do and apply them to mine.

Thanks.

Jipijapa answered 4/9, 2020 at 8:13 Comment(2)
Autoplay policy it's weird. I don't know how Netflix does but, take a look to this developers.google.com/web/updates/2018/11/web-audio-autoplay It says the have an heuristic that checks, if the user should play content on this website, the autoplay is allowed.I don't know a perfect way to allow autoplay easily, only set "muted" and play, in that case, always workAmmamaria
Are you sure you are loading muted? For me always work as muted. But, I don't like this approach, I prefer to load with audio and in that case, the use must click in PLAY button, while the PLAY button is right showed when the player is paused, it's not problem.Ammamaria
A
3

It seems some sites are whitelisted:

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.

Archibald answered 16/5, 2021 at 20:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.