最近发现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. PAT 1021 个位数统计 C语言

    1021. 个位数统计 (15) 给定一个k位整数N = dk-1*10k-1 + ... + d1*101 + d0 (0<=di<=9, i=0,...,k-1, dk-1>0) ...

  2. ballerina 学习十九 安全编程

      ballerina 内部提供了几种常用的安全开发模型,token 认证(jwt) basic auth jwt 安全 参考代码 import ballerina/http; http:AuthPr ...

  3. UVA之1121 - Subsequence

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/SunnyYoona/article/details/25840365 [题目] A sequence ...

  4. 【转】shell 编程:冒号 后面跟 等号,加号,减号,问号的意义

    原文网址:http://blog.csdn.net/trochiluses/article/details/9048539 缺省值(:-)   如果变量后面跟着冒号和减号,则变量后面跟着是这个变量的缺 ...

  5. There is no Action mapped for namespace / and action name login. - [unknown location]

    (自己在浏览器中,直接进入项目的根目录,即 http://localhost:8080/ssh/  时便报错,web.xml文件已经配置了 欢迎页面 <welcome-file-list> ...

  6. Bootstrap-Plugin:弹出框(Popover)插件

    ylbtech-Bootstrap-Plugin:弹出框(Popover)插件 1.返回顶部 1. Bootstrap 弹出框(Popover)插件 弹出框(Popover)与工具提示(Tooltip ...

  7. Bootstrap-CL:徽章

    ylbtech-Bootstrap-CL:徽章 1.返回顶部 1. Bootstrap 徽章(Badges) 本章将讲解 Bootstrap 徽章(Badges).徽章与标签相似,主要的区别在于徽章的 ...

  8. Jenkins构建Python项目提示:'python' 不是内部或外部命令,也不是可运行的程序

    问题描述: jenkin集成python项目,立即构建后,发现未执行成功,查看Console Output 提示:'Python' 不是内部或外部命令,也不是可运行的程序,如下图: 1.在 Windo ...

  9. 利用spring的ApplicationListener监听某一类事件的发生

    1.ApplicationListener在使用过程中可以监听某一事件的发生,可以做出相应的处理,这个方式不常用,但是在特殊情况下面还是有用的. 2.导包pom.xml <project xml ...

  10. python值解析excel

    原文:http://blog.csdn.net/tomatoandbeef/article/details/52253578 一.安装python和xlrd模块 python下载地址,安装好后要配置环 ...