CEF 加载flash 插件

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

  • override OnBeforeCommandLineProcessing函数
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");


}

参考地址:
https://bitbucket.org/chromiumembedded/cef/issues/1586/add-pepper-flash-plugin-support

这里写图片描述

评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值