2015-09-03 53 views
0

問題: 我有一個html文件,通過帶有沙箱的iframe調用另一個html文件。內部文件包含由soundcloud嵌入的iframe。現在這個soundcloud小部件不起作用。嵌入式soundcloud音頻無法與沙盒中的iframe中的鉻合作

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

而且inneriframe.html包含IFRAME我從soundcloud.com inneriframe.html得到的是:

<!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播放器是否可用,通過HTML5運行其他Flash播放器。在這種情況下,它發現Flash播放器是可用的,因此嘗試通過它,但沙箱限制Flash播放器,因此它不起作用。

對於其他文件,也許soundcloud直接通過HTML5運行。此外,由於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? 

回答

0

關於鉻/閃存的問題,我想想可能是什麼好玩的恩,你可能會在Chrome中出現一些衝突的Flash更新。 Chrome默認情況下會集成Flash,每次Chrome更新也會添加最新版本的Flash。如果您已經單獨安裝了Flash,則也可以爲Chrome安裝,因此這兩個版本可能會相互衝突。您需要禁用Flash的第二個實例 - 這就是爲什麼在Chrome中停用插件的原因。然而,我建議您確保您的Chrome版本是最新的和/或通過執行以下操作更新Flash插件:

在Chrome瀏覽器的地址欄中鍵入chrome:// components,然後在「pepper_flash」下單擊「檢查更新」。這可能有效。所以這不是一個普遍問題,它會因機器而異。我知道痛苦。

關於某些問題,這是一個已知的FF-soundcloud問題。顯然,如果你進入Firefox的安全模式,所有的曲目都會播放。 (您可以通過單擊菜單圖標進入安全模式,然後選擇幫助並選擇重新啓動,然後選擇以安全模式啓動(不要刷新Firefox))。

希望這會有所幫助!

Rachel

+0

感謝您的幫助!但首先,我已經驗證過我的chrome上沒有安裝額外的flash播放器,它只有chrome默認的flash播放器。其次,如果我們移除沙箱,它也可以很好地工作。因此,沙箱可能限制了閃光燈的播放。 –

+0

您可能已經安裝了閃存,即安裝在我們的電腦上,或單獨安裝。這可能也是 –