在Windows OS中的电子项目中运行.swf文件 [英] run .swf files in electron project in windows os
问题描述
我有此代码可使用电子js将网站转换为exe文件,但我在网站内有
的问题,那里有.swf文件,我搜索了很多有关如何运行.swf文件的信息,但它不起作用
i是由插件训练的,名称为 Pepper Flash插件
,这是此插件的
i have this code for convert website to exe file using electon js but i have problem inside the website there are .swf files and i search alot about how i can run .swf files but it's not work i was traing by plugin it's name "Pepper Flash Plugin" this is the url for this plugin
https://electron.atom.io/docs/tutorial/using-pepper-flash-plugin/
,而我对 pepflashplayer.dll感兴趣,
and i was searsh about "pepflashplayer.dll"
并将其放在prject目录的根目录上,也不起作用
and put it on the root on prject directory and also not work
请提供任何帮助
file:main.js
'use strict';
const electron = require('electron');
const path = require('path');
const app = electron.app; // Module to control application life.
const BrowserWindow = electron.BrowserWindow; // Module to create native browser window.
// Specify flash path, supposing it is placed in the same directory with main.js.
let pluginName
switch (process.platform) {
case 'win32':
pluginName = 'pepflashplayer.dll'
break
case 'darwin':
pluginName = 'PepperFlashPlayer.plugin'
break
case 'linux':
pluginName = 'libpepflashplayer.so'
break
}
app.commandLine.appendSwitch('ppapi-flash-path', path.join(__dirname, pluginName))
var mainWindow = null;
app.on('ready', function() {
mainWindow = new BrowserWindow({width: 1100, height: 900, webPreferences: {
plugins: true
}});
// and load the index.html of the app.
mainWindow.loadURL('file://' + __dirname + '/cd/cd/START.html');
});
推荐答案
case 'win32':
pluginName = 'pepflashplayer.dll'
您只需要在dll文件所在的目录
You simply need to put in the directory to where your dll file is located
当前(2017年6月)将其存储在:
C:\Users\USER\AppData\ Local\Google\Chrome\UserData\PepperFlash\26.0.0.126
Currently (June 2017) it is stored at: C:\Users\USER\AppData\Local\Google\Chrome\User Data\PepperFlash\26.0.0.126
case 'win32':
pluginName = 'C:\Users\USER\AppData\Local\Google\Chrome\User Data\PepperFlash\26.0.0.126\pepflashplayer.dll'
OR
将dll复制到应用程序的目录并指向该目录
copy the dll to your app's directory and point it to there
case 'win32':
pluginName = './pepflashplayer.dll'
这篇关于在Windows OS中的电子项目中运行.swf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!