[原创]Cef3 2623.1397 开启ppapi flash插件
最近发现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插件的更多相关文章
- CEF 3.2623使用flash插件的方法
PPAPI Flash插件是Chrome浏览器内置的Flash插件,是Google和Adobe合作的产物,于Chrome21(Win)或者Chrome20(Linux)加入,具有沙箱.GPU加速.多进 ...
- js判断浏览器是否安装Flash插件,并提示安装或开启
var flashChecker = function() { var hasFlash = 0; //是否安装了flash var flashVersion = 0; //flash版本 if(do ...
- Android WebView播放视频flash(判断是否安装flash插件)
Android WebView播放flash(判断是否安装flash插件) 最近帮一个同学做一个项目,断断续续的一些知识点记录一下.一个页面中有一个WebView,用来播放swf,如果系统中未安装f ...
- Vivaldi解决flash插件问题
Vivaldi浏览器 Vivaldi是Opera联合创始人.前CEO谭咏文(Jon von Tetzchner)2015年1月27日发布的一款浏览器,具有个性化的笔记功能,带有迷你屏幕截图的书签,以及 ...
- flash插件
偶尔见到别人的博客侧边栏 有一些很有意思的flash插件,也想加入到自己博客里面,这里来大概讲一下~ 一.支持js代码 首先要在 博客设置 >开启博客侧边栏公告的js代码支持,提交审核后 很快 ...
- Chrome浏览器设置自动启用Flash插件
Chrome浏览器设置自动启用Flash插件 1.打开Chrome浏览器,输入chrome://flags/#run-all-flash-in-allow-mode,打开,找到Enable Eph ...
- Ubuntu 手动更新firefox的flash插件
Ubuntu下 Firefox更新flash插件老是提示失败,自己动手丰衣足食啊. 1.下载tar文件,地址:http://get.adobe.com/cn/flashplayer/?no_redir ...
- Flash插件地址
Flash插件地址: http://get.adobe.com/cn/flashplayer/存档版本地址: http://helpx.adobe.com/flash-player/kb/archiv ...
- centos 安装flash插件
方法一: 1.选择合适的yum源http://get.adobe.com/cn/flashplayer/进入此网址选择 “YUM,适用于Linux(YUM)”,下载adobe源http://101.9 ...
随机推荐
- flask第二十二篇——模板【4】过滤器
请关注微信公众号:自动化测试实战 先来教大家一个pycharm设置默认模板的方法.我们每次新建模板或者平时写代码打开以后可能都要重复写# coding: utf-8这些代码,其实我们可以设置好模板,让 ...
- html页面下拉列表中动态添加后台数据(格式化数据,显示出数据的层次感)
html页面下拉列表中动态添加后台数据(格式化数据,显示出数据的层次感) 效果图: 运行原理和技术: 当页面加载完毕,利用jquery向后台发送ajax请求,去后台拼接<select>&l ...
- Gym 100712L Alternating Strings II(单调队列)
题目链接 Alternating Strings II 题意是指给出一个长度为n的01串,和一个整数k,要求将这个01串划分为很多子串(切很多刀),使得每个子串长度不超过k,且每个字串不是01交替出现 ...
- VUE的使用方法
vueInit: function() { var _this = this; this.vue = new Vue({ el: '#pa', data: { //存放初始化数据 sourceData ...
- ACM-Teleportation
我的代码: #include <bits/stdc++.h> using namespace std; int main() { int a,b,x,y; cin>>a> ...
- Bootstrap-Plugin:滚动监听(Scrollspy)插件
ylbtech-Bootstrap-Plugin:滚动监听(Scrollspy)插件 1.返回顶部 1. Bootstrap 滚动监听(Scrollspy)插件 滚动监听(Scrollspy)插件,即 ...
- Go语言面组合式向对象编程基础总结
转自:http://blog.csdn.net/yue7603835/article/details/44282823 Go语言的面向对象编程简单而干净,通过非侵入式接口模型,否定了C/C++ Jav ...
- ffmpeg重要的参考学习网址
http://lib.csdn.net/liveplay/knowledge/1586 FFmpeg滤镜使用指南 http://blog.csdn.net/fireroll/article/detai ...
- WCF传输大数据 --断点续传(upload、download)
using System; using System.IO; using System.Runtime.Serialization; using System.ServiceModel; namesp ...
- 517. Super Washing Machines
▶ 超级洗碗机.给定一个有 n 元素的整数数组,我们把 “将指定位置上元素的值减 1,同时其左侧或者右侧相邻元素的值加 1” 称为一次操作,每个回合内,可以选定任意 1 至 n 个位置进行独立的操作, ...