CEF 加载flash 插件
发布时间:2020-12-15 20:01:14 所属栏目:百科 来源:网络整理
导读: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 CCefClien
CEF可以通过命令行设置加载flash插件,有两种方式:
class CCefClientApp : public CefApp,public CefBrowserProcessHandler
{
public:
CCefClientApp();
~CCefClientApp();
// CefApp methods:
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() override
{
return this;
}
virtual void OnBeforeCommandLineProcessing(const CefString& process_type,CefRefPtr<CefCommandLine> command_line) override;
// CefBrowserProcessHandler methods:
virtual void OnContextInitialized() override;
private:
// Include the default reference counting implementation.
IMPLEMENT_REFCOUNTING(CCefClientApp);
private:
};
void CCefClientApp::OnBeforeCommandLineProcessing(const CefString & process_type,CefRefPtr<CefCommandLine> command_line)
{
//加载flash插件
command_line->AppendSwitchWithValue("--ppapi-flash-path","ppflash/18_0_0_209/pepflashplayer32_18_0_0_209.dll");
//manifest.json中的version
command_line->AppendSwitchWithValue("--ppapi-flash-version","18.0.0.209");
}
参考地址: (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |