gpt4 book ai didi

flash - 如何在 Electron 应用中使闪光灯正常工作?

转载 作者:行者123 更新时间:2023-12-03 12:22:27 24 4
gpt4 key购买 nike

我正在尝试为Flash游戏创建启动器。我是 Electron 和编程方面的新手,所以我正在阅读 Electron 文档,但我的闪光灯无法正常工作。

const electron = require('electron')
const { app, BrowserWindow } = require('electron')
const path = require('path');
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))
function createWindow () {
// Create the browser window.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
plugins: true,
webviewTag: true
}
})
win.removeMenu(BrowserWindow);

// and load the index.html of the app.
win.loadFile('index.html')

win.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
win = null
})

}

app.on('ready', createWindow)

app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})

app.on('activate', () => {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (win === null) {
createWindow()
}
})

该站点正常加载,但闪光灯不起作用。所以,我做错了什么吗?我该如何运作?

谢谢!

Obs:这是我的main.js

最佳答案

代表OP张贴

使用较旧的 Electron 版本(4.2.6)。较新的 Electron 版本(高于4.2.6)将不会加载闪存内容。

编辑:在Linux中,来自4.2.x系列的最新 Electron 版将与Flash Player一起使用。在Windows中,最新版本正常工作

关于flash - 如何在 Electron 应用中使闪光灯正常工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58017490/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com