最近发现WKE播放Flash或者游戏时会有很多BUG,例如视频无法播放或者是Stage3D无法使用等问题。

经过研究应该是精简版本导致的,所以决定尝试使用CEF3移植入SOUI,但是DEMO中版本有点旧,所以想升级。

发现23XX版本开始 无法直接使用npapi的flash插件,默认是关闭的

这里以CEF的DEMO程序CEFCLIENT为例子:

有2种方式可以启动FLASH插件,但是我不推荐NPAPI方式,实际上非常不好,据说是效率低下以及不稳定。

所以这里默认为PPAPI的方式。

(这里说的是FLASH插件的NPAPI版本卡,不是说NPAPI卡,我措辞不严谨,和PPAPI和NPAPI本身技术无关,仅仅针对FLASH插件,不信的自己可以试试)

首先要做的:

在CEFCLIENT目录下新建目录 PepperFlash 把下载好的 pepflashplayer.dll 插件丢入该目录即可。

然后跟着以下方法做。

方法1:

直接给编译好的CEFCLIENT创建一个快捷方式 快捷方式后加入参数 --register-pepper-plugins="PepperFlash/pepflashplayer.dll;application/x-shockwave-flash" 然后使用快捷方式启动即可发现FLASH正常播放。

如果希望开启NPAPI方式,再加入参数 --enable-npapi 即可。

方法2:

不像以上方法,需要快捷方式等,可以无参数启动。

打开源码 CEFCLIENT,并且打开文件 client_app_browser.cc 文件,找到函数 OnBeforeCommandLineProcessing。

 void ClientAppBrowser::OnBeforeCommandLineProcessing(
const CefString& process_type,
CefRefPtr<CefCommandLine> command_line) {
// Pass additional command-line flags to the browser process.
if (process_type.empty()) {
// Pass additional command-line flags when off-screen rendering is enabled.
if (command_line->HasSwitch(switches::kOffScreenRenderingEnabled)) {
// If the PDF extension is enabled then cc Surfaces must be disabled for
// PDFs to render correctly.
// See https://bitbucket.org/chromiumembedded/cef/issues/1689 for details.
if (!command_line->HasSwitch("disable-extensions") &&
!command_line->HasSwitch("disable-pdf-extension")) {
command_line->AppendSwitch("disable-surfaces");
} // Use software rendering and compositing (disable GPU) for increased FPS
// and decreased CPU usage. This will also disable WebGL so remove these
// switches if you need that capability.
// See https://bitbucket.org/chromiumembedded/cef/issues/1257 for details.
if (!command_line->HasSwitch(switches::kEnableGPU)) {
command_line->AppendSwitch("disable-gpu");
command_line->AppendSwitch("disable-gpu-compositing");
} // Synchronize the frame rate between all processes. This results in
// decreased CPU usage by avoiding the generation of extra frames that
// would otherwise be discarded. The frame rate can be set at browser
// creation time via CefBrowserSettings.windowless_frame_rate or changed
// dynamically using CefBrowserHost::SetWindowlessFrameRate. In cefclient
// it can be set via the command-line using `--off-screen-frame-rate=XX`.
// See https://bitbucket.org/chromiumembedded/cef/issues/1368 for details.
command_line->AppendSwitch("enable-begin-frame-scheduling");
} // 此参数解决多窗口问题
command_line->AppendSwitch("process-per-site");
command_line->AppendSwitch("enable-npapi");
command_line->AppendSwitchWithValue("register-pepper-plugins", "PepperFlash/pepflashplayer.dll;application/x-shockwave-flash"); DelegateSet::iterator it = delegates_.begin();
for (; it != delegates_.end(); ++it)
(*it)->OnBeforeCommandLineProcessing(this, command_line);
}
}

修改代码如上,重新编译即可。

再打开YOUKU看看,是不是OK了。

还有发现右键菜单都是英文,这里可以在SETTINGS中设置参数locale为zh-CN即可。

   std::string locale("zh-CN");
cef_string_utf8_to_utf16(locale.c_str(), locale.size(), &settings.locale);

[原创]Cef3 2623.1397 开启ppapi flash插件的更多相关文章

  1. CEF 3.2623使用flash插件的方法

    PPAPI Flash插件是Chrome浏览器内置的Flash插件,是Google和Adobe合作的产物,于Chrome21(Win)或者Chrome20(Linux)加入,具有沙箱.GPU加速.多进 ...

  2. js判断浏览器是否安装Flash插件,并提示安装或开启

    var flashChecker = function() { var hasFlash = 0; //是否安装了flash var flashVersion = 0; //flash版本 if(do ...

  3. Android WebView播放视频flash(判断是否安装flash插件)

    Android WebView播放flash(判断是否安装flash插件)  最近帮一个同学做一个项目,断断续续的一些知识点记录一下.一个页面中有一个WebView,用来播放swf,如果系统中未安装f ...

  4. Vivaldi解决flash插件问题

    Vivaldi浏览器 Vivaldi是Opera联合创始人.前CEO谭咏文(Jon von Tetzchner)2015年1月27日发布的一款浏览器,具有个性化的笔记功能,带有迷你屏幕截图的书签,以及 ...

  5. flash插件

    偶尔见到别人的博客侧边栏 有一些很有意思的flash插件,也想加入到自己博客里面,这里来大概讲一下~ 一.支持js代码 首先要在  博客设置 >开启博客侧边栏公告的js代码支持,提交审核后 很快 ...

  6. Chrome浏览器设置自动启用Flash插件

    Chrome浏览器设置自动启用Flash插件   1.打开Chrome浏览器,输入chrome://flags/#run-all-flash-in-allow-mode,打开,找到Enable Eph ...

  7. Ubuntu 手动更新firefox的flash插件

    Ubuntu下 Firefox更新flash插件老是提示失败,自己动手丰衣足食啊. 1.下载tar文件,地址:http://get.adobe.com/cn/flashplayer/?no_redir ...

  8. Flash插件地址

    Flash插件地址: http://get.adobe.com/cn/flashplayer/存档版本地址: http://helpx.adobe.com/flash-player/kb/archiv ...

  9. centos 安装flash插件

    方法一: 1.选择合适的yum源http://get.adobe.com/cn/flashplayer/进入此网址选择 “YUM,适用于Linux(YUM)”,下载adobe源http://101.9 ...

随机推荐

  1. Jenkins构建常见问题

    最近在用jenkins搭建.NET自动编译发布环境时遇到的一些问题,解释不一定都对,仅记录以备后用. 1.MSBUILD : error MSB1008: 只能指定一个项目 Build a Visua ...

  2. Python面试题(十三)

    1.用最简洁的方式初始化这样一个变量:foo = [4,16,36,64,100] [i*i for i in range(2,12,2)] 答案 2.使用生成器编写fib函数,函数声明为fib(ma ...

  3. leetcode:Insert Sort List

    问题描写叙述 对一个单链表进行插入排序,head指向第一个结点. 代码 /** * Definition for singly-linked list. * struct ListNode { * i ...

  4. CentOS7 tomcat systemctl脚本

    1,centos7 使用 systemctl 替换了 service命令 参考:redhat文档: https://access.redhat.com/documentation/en-US/Red_ ...

  5. nginx rewrite规则实例讲解

    一.正则表达式匹配,其中: * ~ 为区分大小写匹配* ~* 为不区分大小写匹配* !~和!~*分别为区分大小写不匹配及不区分大小写不匹配 二.文件及目录匹配,其中:* -f和!-f用来判断是否存在文 ...

  6. VHF、UHF的频率范围

    1.VHF意思是甚高频,2.UHF意思是超高频,即ultra-high freqency ,电视搜台显示的是当前频率段名,最高不超过470M,因为带增补的高频头标准就是470M3.这是对讲机专业机的工 ...

  7. TS/ES/PS

    数字信号实际传送的是数据流,一般数据流包括以下三种: ES流(Elementary Stream): 也叫基本码流,包含视频.音频或数据的连续码流. PES流(Packet Elementary St ...

  8. Top Android App使用的组件(应用)

    Top Android App使用的组件   唱吧_462 smack:de.measite.smack:??? ???:org.apache:??? smack:org.jivesoftware.s ...

  9. HDU 3179 二叉搜索树(树的建立)

    二叉搜索树 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  10. logger示例

    胜哥版 打印日志是很多程序的重要需求,良好的日志输出可以帮我们更方便的检测程序运行状态.Python标准库提供了logging模块,让我们也可以方便的在Python中打印日志. 日志介绍 完整的使用方 ...