首页 > 解决方案 > 构建后,电子闪光无法工作

问题描述

当我使用时npm run dev,电子闪光灯可以工作。但是我为win10构建了程序.exe,电子闪光灯无法工作,我该如何处理?我使用 electron-vue 框架,这是我的电子配置:

/src/main/index.js

const pepflashplayer = app.getPath('pepperFlashSystemPlugin');
app.commandLine.appendSwitch('ppapi-flash-path', pepflashplayer);
app.commandLine.appendSwitch('ppapi-flash-version', '30.0.0.154'); 


mainWindow = new BrowserWindow({
   height: 563,
   useContentSize: true,
   width: 1250,
   webPreferences:{
     plugins : true
   }
})

src/renderer/components/XX.vue

<webview :src="**.swf" plugins autosize
   style="height:100%;margin:0 auto" id="webFlash">
</webview>

标签: flashelectron

解决方案


但是我为 Win 10 构建了程序.exe,Electron Flash 无法工作。
我该如何处理?

我不使用 Electron,所以我不知道这是否能解决您的问题,但通常您不会直接在 Pepper API 浏览器中加载 SWF 文件。尝试确保您srchtml文件本身具有embed所需 Flash SWF 文件的代码。

如果XX.vue是加载页面内容的...

<webview :src="test.html" plugins autosize
   style="height:100%;margin:0 auto" id="webFlash">
</webview>

test.html代码看起来像这样的地方:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <body>
    <embed src="yourFile.swf" width="800" height="600">
  </body>
</html>

让我知道事情的后续。


推荐阅读