Skip to content

Instantly share code, notes, and snippets.

@heitara
Last active July 31, 2020 23:47
Show Gist options
  • Save heitara/2aa73ee0e71d9f6c730d7ece486a7c24 to your computer and use it in GitHub Desktop.
Save heitara/2aa73ee0e71d9f6c730d7ece486a7c24 to your computer and use it in GitHub Desktop.
How to load properly PepperFlash in Electron on Mac
//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');
{
"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