問題: 我有一個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&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&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&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&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&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&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播放器。其次,如果我們移除沙箱,它也可以很好地工作。因此,沙箱可能限制了閃光燈的播放。 –
您可能已經安裝了閃存,即安裝在我們的電腦上,或單獨安裝。這可能也是 –