【问题标题】:Iframe allow=autoplay not workinf on firefoxiframe 允许 = 自动播放在 Firefox 上不起作用
【发布时间】:2019-07-07 04:28:27
【问题描述】:

我正在使用 soundcloud 嵌入 iframe 代码。 soundcloud 有自动播放音频的选项,它在 iframe src 属性中定义为 &auto_play=true url 参数。

但是还有其他 iframe 属性 allow="autoplay 'none'" 不允许 iframe 播放该音频,并且它在 Firefox 中不起作用。

https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide#Example_Disabling_autoplay

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#Browser_compatibility

HTML:

<iframe width="100%" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/148714961&color=%23ea00ff&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>

https://codepen.io/balancana/pen/WPKjoE

问题是我想停止 soundcloud iframe 音频文件播放 不管auto_play url参数是什么。

【问题讨论】:

  • 只需删除allow 属性。默认情况下,它会因不存在而被禁用。
  • @zer00ne 嗯,但它仍然会在 Firefox 中自动播放 codepen.io/balancana/pen/OdwjwP Firefox 有什么解决方法吗?
  • ATM 这个lame plugin 是个人用户的解决方案,但对于那里的开发人员ain't no such thang

标签: html firefox iframe soundcloud


【解决方案1】:

您必须允许火狐有权自动播放音频 click this link to see

【讨论】:

  • 这仅适用于一个消费者 - 意味着“你”,而不适用于试图为“所有”消费者嵌入内容的开发人员 ;-)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-03-06
  • 2019-08-07
  • 2020-01-13
  • 2018-10-18
  • 2018-12-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多