阿特拉斯
小狐狸
小狐狸
  • UID57459
  • 注册日期2020-02-04
  • 最后登录2021-11-13
  • 发帖数9
  • 经验16枚
  • 威望0点
  • 贡献值22点
  • 好评度0点
阅读:4408回复:2

禁止自动播放音频视频有时候失效

楼主#
更多 发布于:2021-11-01 10:06
百度贴吧不知道用了什么方法,绕过了禁止音频视频自动播放的设置,比如一些游戏贴吧里玩家的录屏,在帖子列表鼠标滑过就会自动播放,在帖子里不会。举个例子
https://tieba.baidu.com/p/7575781632
https://tieba.baidu.com/f?kw=%E6%96%B9%E8%88%9F%E7%94%9F%E5%AD%98%E8%BF%9B%E5%8C%96&ie=utf-8&tp=0&pn=50
这个贴吧里   就有个别会自动播放
lonely_8
非常火狐
非常火狐
  • UID30273
  • 注册日期2009-09-03
  • 最后登录2022-08-09
  • 发帖数733
  • 经验469枚
  • 威望0点
  • 贡献值86点
  • 好评度147点
  • 社区居民
  • 忠实会员
1楼#
发布于:2021-11-03 20:44
about:config 中将 media.autoplay.blocking_policy 设置为 1 就好。
默认 0,比较宽松,某些情况下鼠标划过被认为有用户交互,是有点误判。

关于取值
This pref defines what the blocking policy would be used in blocking autoplay.
0 : use sticky activation (default) https://html.spec.whatwg.org/multipage/interaction.html#sticky-activation
1 : use transient activation (the transient activation duration can be adjusted by the pref `dom.user_activation.transient.timeout`) https://html.spec.whatwg.org/multipage/interaction.html#transient-activation
2 : user input depth (allow autoplay when the play is trigged by user input which is determined by the user input depth)
阿特拉斯
小狐狸
小狐狸
  • UID57459
  • 注册日期2020-02-04
  • 最后登录2021-11-13
  • 发帖数9
  • 经验16枚
  • 威望0点
  • 贡献值22点
  • 好评度0点
2楼#
发布于:2021-11-05 21:38
发现有个很神奇的现象,地址栏前边那里设置成阻止音频视频,然后值设为1,视频仍然会播放,但是没声音
游客

返回顶部