Last active
July 31, 2020 23:47
-
-
Save heitara/2aa73ee0e71d9f6c730d7ece486a7c24 to your computer and use it in GitHub Desktop.
How to load properly PepperFlash in Electron on Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this is jsut the "meat" of the solution | |
const PEPPERFLASH_PLUGIN = __dirname.indexOf("asar") >=0 ? '../resources/pepperFlash/mac/PepperFlashPlayer.plugin' : 'resources/pepperFlash/mac/PepperFlashPlayer.plugin' | |
let pluginName | |
switch (process.platform) { | |
case 'win32': | |
switch (process.arch) { | |
case "x64": | |
pluginName = PEPPERFLASH_PLUGIN_WIN64 | |
break; | |
default: | |
pluginName = PEPPERFLASH_PLUGIN_WIN32 | |
break; | |
} | |
break | |
case 'darwin': | |
pluginName = PEPPERFLASH_PLUGIN | |
break | |
} | |
let flashPath = path.join(__dirname, pluginName); | |
app.commandLine.appendSwitch('ppapi-flash-path', flashPath); | |
app.commandLine.appendSwitch('ppapi-flash-version', '28.0.0.126'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"asar" : true, | |
"extraResources": [ | |
"./public/**", | |
"./resources/pepperFlash/mac/**" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment