摘要:本文主要向大家介绍了Flash基础入门之Cef3 2623.1397 开启ppapi flash插件,通过具体的内容向大家展现,希望对大家学习Flash基础入门有所帮助。
本文主要向大家介绍了Flash基础入门之Cef3 2623.1397 开启ppapi flash插件,通过具体的内容向大家展现,希望对大家学习Flash基础入门有所帮助。
最近发现WKE播放Flash或者游戏时会有很多BUG,例如视频无法播放或者是Stage3D无法使用等问题。
经过研究应该是精简版本导致的,所以决定尝试使用CEF3移植入SOUI,但是DEMO中版本有点旧,所以想升级。
发现23XX版本开始 无法直接使用npapi的flash插件,默认是关闭的
这里以CEF的DEMO程序CEFCLIENT为例子:
有2种方式可以启动FLASH插件,但是我不推荐NPAPI方式,实际上非常不好,据说是效率低下以及不稳定。
所以这里默认为PPAPI的方式。
首先要做的:
在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。
1 void ClientAppBrowser::OnBeforeCommandLineProcessing(
2 const CefString& process_type,
3 CefRefPtr<CefCommandLine> command_line) {
4 // Pass additional command-line flags to the browser process.
5 if (process_type.empty()) {
6 // Pass additional command-line flags when off-screen rendering is enabled.
7 if (command_line->HasSwitch(switches::kOffScreenRenderingEnabled)) {
8 // If the PDF extension is enabled then cc Surfaces must be disabled for
9 // PDFs to render correctly.
10 // See https://bitbucket.org/chromiumembedded/cef/issues/1689 for details.
11 if (!command_line->HasSwitch("disable-extensions") &&
12 !command_line->HasSwitch("disable-pdf-extension")) {
13 command_line->AppendSwitch("disable-surfaces");
14 }
15
16 // Use software rendering and compositing (disable GPU) for increased FPS
17 // and decreased CPU usage. This will also disable WebGL so remove these
18 // switches if you need that capability.
19 // See https://bitbucket.org/chromiumembedded/cef/issues/1257 for details.
20 if (!command_line->HasSwitch(switches::kEnableGPU)) {
21 command_line->AppendSwitch("disable-gpu");
22 command_line->AppendSwitch("disable-gpu-compositing");
23 }
24
25 // Synchronize the frame rate between all processes. This results in
26 // decreased CPU usage by avoiding the generation of extra frames that
27 // would otherwise be discarded. The frame rate can be set at browser
28 // creation time via CefBrowserSettings.windowless_frame_rate or changed
29 // dynamically using CefBrowserHost::SetWindowlessFrameRate. In cefclient
30 // it can be set via the command-line using `--off-screen-frame-rate=XX`.
31 // See https://bitbucket.org/chromiumembedded/cef/issues/1368 for details.
32 command_line->AppendSwitch("enable-begin-frame-scheduling");
33 }
34
35 // 此参数解决多窗口问题
36 command_line->AppendSwitch("process-per-site");
37 command_line->AppendSwitch("enable-npapi");
38 command_line->AppendSwitchWithValue("register-pepper-plugins", "PepperFlash/pepflashplayer.dll;application/x-shockwave-flash");
39
40 DelegateSet::iterator it = delegates_.begin();
41 for (; it != delegates_.end(); ++it)
42 (*it)->OnBeforeCommandLineProcessing(this, command_line);
43 }
44 }
修改代码如上,重新编译即可。
再打开YOUKU看看,是不是OK了。
还有发现右键菜单都是英文,这里可以在SETTINGS中设置参数locale为zh-CN即可。
以上就介绍了Flash的相关知识,希望对Flash有兴趣的朋友有所帮助。了解更多内容,请关注职坐标常用软件Flash频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号