Node-webkit 集成 Flash插件

本文介绍如何在Node-WebKit应用中集成Flash插件。通过修改package.json启用插件功能,并将Chrome的PepperFlash文件夹复制到nw.js目录下完成集成。
node-webkit

历史版本下载地址: https://npm.taobao.org/mirrors/nwjs

项目有个需求要求node-webkit集成Flash插件,node-webkit 支持 NPAPI 规范的插件

步骤一:启用插件功能

首先在你前端项目中的 package.json 中加入如下配置来启用插件功能

"webkit": {
    "plugin": true
}

添加完毕,你的 package.json 大概是这样的

{

    "main": "index.html",

    "name": "nw-demo",

    "description": "demo app of node-webkit",

    "version": "0.0.1",
    "window": {

        "title": "node-webkit demo",

        "toolbar": true,

        "frame": true,

        "width": 1000,

        "height": 700,

        "position": "center",

        "min_width": 400,

        "min_height": 200,

        "max_width": 1920,

        "max_height": 1080,

        "resizable": true
    },
    "webkit": {

        "plugin": true
    }
}

步骤二:导入 Flash 插件

根据 在nw.js中显示Flash 中提到 的 将 Chrome 安装目录下的 PepperFlash 这个文件夹复制到了nw.js 的目录中。

将 Chrome 中位于 Google\Chrome\Application 下的 PepperFlash 文件夹提取出来,放入 nw.exe同 目录下。

可用PepperFlash插件下载地址:https://download.csdn.net/download/tichangde/10421867

参考:https://www.cphayim.me/blog/use-flash-in-nwjs.html


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值