如何处理“Uncaught(in promise)DOMException:play()失败,因为用户没有首先与文档交互。”在桌面上使用Chrome 66? [英] How to handle "Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first." on Desktop with Chrome 66?
问题描述
我收到错误消息..
未捕获(在承诺中)DOMException:play()失败,因为用户没有'首先与文档进行交互。
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.
..尝试使用Chrome版本66在桌面上播放视频时。
..when trying to play video on desktop using Chrome version 66.
我确实发现一个广告在网站上自动开始播放,但使用以下HTML:
I did find an ad that began playback automatically on a website however using the following HTML:
<video
title="Advertisement"
webkit-playsinline="true"
playsinline="true"
style="background-color: rgb(0, 0, 0); position: absolute; width: 640px; height: 360px;"
src="http://ds.serving-sys.com/BurstingRes/Site-2500/Type-16/1ff26f6a-aa27-4b30-a264-df2173c79623.mp4"
autoplay=""></video>
所以绕过Chrome v66的自动播放拦截器就像添加 webkit-playsinline =true
, playsinline =true
, autoplay =
属性到< video>
元素?对此有任何负面影响吗?
So is by-passing Chrome v66's autoplay blocker really as easy as just adding the webkit-playsinline="true"
, playsinline="true"
, and autoplay=""
attributes to the <video>
element? Are there any negative consequences to this?
推荐答案
- 打开
chrome:/ / flags /#autoplay-policy
- 设置无需用户手势
- 重新启动Chrome
这篇关于如何处理“Uncaught(in promise)DOMException:play()失败,因为用户没有首先与文档交互。”在桌面上使用Chrome 66?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!