Muted Autoplay video shows error: play() failed because the user didn't interact with the document first.

前端 未结 1 1114
别那么骄傲
别那么骄傲 2020-12-07 05:15

I am trying to make an HTML5 video autoplay (in muted condition) in the popup in the page. The popup is hidden when page is loaded. When user tries to go out of page (from t

相关标签:
1条回答
  • 2020-12-07 05:48

    Google Chrome has updated the autoplay policies. URL for reference

    According to new behaviours:

    1. Muted autoplay is always allowed.
    2. Autoplay with sound is allowed if:
      • User has interacted with the domain (click, tap, etc.).
      • On desktop,the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound.
      • On mobile,the user has added the site to his or her home screen.
    3. Top frames can delegate autoplay permission to their iframes to allow autoplay with sound.
    0 讨论(0)
提交回复
热议问题