CEF可以通过命令行设置加载flash插件,有两种方式:
cef.exe --ppapi-flash-path=ppflash/18_0_0_209/pepflashplayer32_18_0_0_209.dll --ppapi-flash-version=18.0.0.209
- 重载OnBeforeCommandLineProcessing函数
class CCefClientApp : public CefApp, public CefBrowserProcessHandler
{
public:
CCefClientApp();
~CCefClientApp();
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override
{
return this;
}
virtual void OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line) override;
virtual void OnContextInitialized() override;
private:
// Include the default reference counting implementation.
IMPLEMENT_REFCOUNTING(CCefClientApp);
private:
};
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
void CCefClientApp::OnBeforeCommandLineProcessing(const CefString & process_type, CefRefPtr<CefCommandLine> command_line)
{
command_line->AppendSwitchWithValue("--ppapi-flash-path", "ppflash/18_0_0_209/pepflashplayer32_18_0_0_209.dll");
command_line->AppendSwitchWithValue("--ppapi-flash-version", "18.0.0.209");
}
参考地址:
https://bitbucket.org/chromiumembedded/cef/issues/1586/add-pepper-flash-plugin-support