我正在尝试自动播放视频,它适用于safari和firefox,但不适用于chrome . 我有muted属性,我也尝试用typescript来播放但是得到一个错误,例如:“Uncaught(在promise中)DOMException:play()失败,因为用户没有先与文档交互”,我知道它与谷歌的新政治有关,但我该怎么做才能解决这个问题呢?提前致谢
似乎是一项新的Google政策,cf
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
和Muted Autoplay video shows error: play() failed because the user didn't interact with the document first.
document.getElementById('video1').play(); 加载您6个月前工作的视频后,似乎从现在开始不可能...
document.getElementById('video1').play();
1 回答
似乎是一项新的Google政策,cf
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
和Muted Autoplay video shows error: play() failed because the user didn't interact with the document first.
document.getElementById('video1').play();
加载您6个月前工作的视频后,似乎从现在开始不可能...