嵌入式 soundcloud 音频不适用于 chrome 中 iframe 中的沙箱

Embedded soundcloud audio does not work with sandbox in iframes in chrome

问题: 我有一个 html 文件,它通过带有沙箱的 iframe 调用另一个 html 文件。内部文件包含由 soundcloud 提供的要嵌入的 iframe。现在这个 soundcloud 小部件不工作了。

<!DOCTYPE html> <html> <head></head> <body> <iframe width= "100%" height="450" src= "inneriframe.html" sandbox></iframe> </body> </html>

并且 inneriframe.html 包含我从 soundcloud.com inneriframe.html 获得的 iframe 是:

<!DOCTYPE html> <html> <head></head> <body> <iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/users/36700916&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true" ></iframe> </body> </html>

观察:

 1. It works for some files and does not work for others.
 2. It works on firefox and not on chrome.
 3. If we disable flash player from chrome plugins, it works.

可能原因: 也许对于某些文件,soundcloud 首先检查 flash player 是否可用,运行 通过 flash player,否则通过 HTML5。在这种情况下,它发现 Flash 播放器可用,因此尝试通过它,但沙盒限制了 Flash 播放器,因此它不起作用。

对于其他文件,也许 soundcloud 直接 运行s 到 HTML5。此外,由于 chrome 最严格地实施沙箱,因此仅在 chrome 中存在问题。

工作嵌入:

<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/211417319&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>

无效嵌入:

<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/216846955&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>

请帮助我:

1. resolving issue, if there is some way.
2. to differentiate files which works and which does not work and why?

关于 Chrome/Flash 问题,我认为可能发生的情况是您在 Chrome 中可能有一些冲突的 Flash 更新。 Chrome 默认集成了 Flash,每次更新 Chrome 也会添加最新版本的 Flash。如果您单独安装了 Flash,它也可以为 Chrome 安装,因此这两个版本可能会相互冲突。您需要禁用一个/第二个 Flash 实例 - 这就是为什么禁用 Chrome 中的插件有效。但是,我建议您确保您的 Chrome 版本是最新的 and/or,并通过执行以下操作更新您的 Flash 插件:

在地址栏 [of Chrome] 中键入 chrome://components,然后在 "pepper_flash," 下单击 'Check for update'。那可能行得通。所以这不是一个普遍的问题,它会因机器而异。痛,我知道。

关于some-play some-don't的问题,这是一个已知的FF-soundcloud问题。显然,如果您输入 Firefox 'Safe mode',所有曲目都会播放。 (您可以通过单击菜单图标进入安全模式,然后单击帮助和 select 在禁用加载项的情况下重新启动,然后 select 在安全模式下启动(不要刷新 Firefox))。

希望对您有所帮助!

雷切尔