Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

as3 pepperFlash check on runtime

How to check if flashPlayer version s pepperFlash on runtime?

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

Update:

I found one javascript function, so if anyone can help me to call it with 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;
like image 714
ThanksBro Avatar asked Jul 02 '13 08:07

ThanksBro


1 Answers

Just update of 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+"')");
        }
like image 90
fsbmain Avatar answered Nov 08 '22 00:11

fsbmain