我正在开发一个在Facebook上运行的flash播放器游戏。我正在尝试检测客户端浏览器是否使用swfobject.js安装了闪存播放器插件(第2.2版)。我在facebook的iframe里面玩游戏。下面是我的代码片段:
<iframe src='....'>
//content inside the iframe
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
var playerVersion = swfobject.getFlashPlayerVersion();
if(playerVersion.major >= 14) {
swfobject.embedSWF(......); //code for loading swf object
}else{
document.write("<a href='https://www.adobe.com/go/getflashplayer' alt='To view this page ensure that Adobe Flash Player version 14 is installed. Get Adobe Flash player.' id='installFlashContent'></a>");
}
</script>
.....
</iframe>swfobject.getFlashPlayerVersion() -这是返回我0,即使我有闪存插件安装在我的火狐浏览器。
如果直接打开my (右键单击此框架>在New中打开框架),则闪存播放机将被正确检测为:
{
major : 28
minor : 0
release : 0
}深入研究代码,我发现当我在Facebook上运行代码时,navigator.plugins.length on swfobject.js正在返回我的0。
对此有什么想法吗?提前谢谢你。
https://stackoverflow.com/questions/48101307
复制相似问题