electron中使用flash插件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let pluginName = null
let pluginPath = null
switch (process.platform) {
case 'win32':
pluginName = 'pepflashplayer.dll'
break
case 'darwin':
pluginName = 'PepperFlashPlayer.plugin'
break
case 'linux':
pluginName = 'libpepflashplayer.so'
break
}
// 根据你的路径修改,这里做打包后路径判断
if (__dirname.includes(".asar")) {
pluginPath = path.join(process.resourcesPath + '/lib/' + pluginName)
} else {
pluginPath = path.resolve(__dirname + '/lib/' + pluginName)
}

app.commandLine.appendSwitch('ppapi-flash-path', pluginPath)

app.commandLine.appendSwitch('ppapi-flash-version', '32.0.0.363')
阅读更多