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.

  • 1
    Autoplay policy it's weird. I don't know how Netflix does but, take a look to this https://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 work – Kalamarico Sep 28 '20 at 18:02
  • 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. – Kalamarico Sep 29 '20 at 13:08

1 Answers1

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.

Jan Molnár
  • 410
  • 7
  • 14