As3 pepperFlash check runtime

How to check if pepperFlash version for flashPlayer at runtime?

I want to handle stage3d differently for pepperflash and differently for the standard version of flash player

Update:

I found one javascript function, so if anyone can help me call it using 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; 
+7
google-chrome flash actionscript-3
source share
2 answers

Just update your answer for more readable JS in AS3:

  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+"')"); } 
+1
source share

here's how:

  _hasPepperFlash = String(ExternalInterface.call("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;} ")) 

Beware that it should be on the same line, all or fail. At least in my IntelliJ IDE

0
source share

All Articles