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

I am trying to make an HTML5 video autoplay (in muted condition) in the popup in the page. The popup is

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 top), it shows video popup with AutoPlay & muted ON. Then I tried to play video with JavaScript but it gives this error: play() failed because the user didn't interact with the document first.

It works fine if I click somewhere on page or if developer panel is open before the video popup is displayed. I am using Flow Player, and issue only in Google Chrome (works fine on FF).

Can you please give any ideas on how to overe this?

Thanks, J

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 top), it shows video popup with AutoPlay & muted ON. Then I tried to play video with JavaScript but it gives this error: play() failed because the user didn't interact with the document first.

It works fine if I click somewhere on page or if developer panel is open before the video popup is displayed. I am using Flow Player, and issue only in Google Chrome (works fine on FF).

Can you please give any ideas on how to overe this?

Thanks, J

Share Improve this question asked Jun 26, 2018 at 11:16 Jignesh KheniJignesh Kheni 1,3121 gold badge9 silver badges22 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745112813a4611945.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信