如何在运行时检查flashPlayer版本的pepperFlash?
我想对Pepperflash和标准Flash Player版本分别处理stage3d
更新:
我找到了一个javascript函数,因此如果有人可以帮助我使用ExternalInterface进行调用:
var checkForPepper = function() {
if (navigator.plugins) {
for (var i=0, count = navigator.plugins.length; i < count; i++) {
var filename = navigator.plugins[i].filename;
if (filename === 'pepflashplayer.dll' || filename === 'PepperFlashPlayer.plugin') return true;
}
}
return false;
最佳答案
只需更新您的答案以获取AS3中更具可读性的JS:
var js:XML = <js>
<![CDATA[
function() {
if (navigator.plugins) {
for (var i=0, count = navigator.plugins.length; i < count; i++) {
var filename = navigator.plugins[i].filename;
if (filename === 'pepflashplayer.dll' || filename === 'PepperFlashPlayer.plugin')
return true;
}
}
return false;
}
]]>
</js>
if(ExternalInterface.available)
{
var isPepper:Boolean = ExternalInterface.call(js);
ExternalInterface.call("alert('isPepper = "+isPepper+"')");
}
关于actionscript-3 - as3 pepperFlash在运行时检查,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17420928/