UE4 WebBrowser 如何支持Flash

翻译:https://answers.unrealengine.com/questions/544321/enable-cef3-pepper-flash-plugin.html

第一步:Engine\Source\Runtime\WebBrowser\Private\WebBrowserSingleton.cpp 

  1. CEFBrowserApp = new FCEFBrowserApp;  //在这句话后面添加如下内容
  2. CefRefPtr<CefCommandLine> command_line = CefCommandLine::CreateCommandLine();
  3. command_line->AppendSwitchWithValue("ppapi-flash-path", "pepflashplayer.dll");
  4. command_line->AppendSwitchWithValue("ppapi-flash-version", "26.0 r0");//根据你自己的flash版本
  5. command_line->AppendSwitchWithValue("plugin-policy", "allow");
  6. command_line->AppendSwitchWithValue("enable-system-flash", "1");
  7.  
  8. FCommandLine::Append(TEXT(" --enable-system-flash=1 --plugin-policy=allow "));
  9. CEFBrowserApp->OnRenderProcessThreadCreated().BindRaw(this, &FWebBrowserSingleton::HandleRenderProcessCreated);
  10. //....
  11. Settings.no_sandbox = false;
  12. Settings.command_line_args_disabled = false;


    第二步:createbrowserwindow函数中添加
  13. BrowserSettings.plugins = STATE_ENABLED;
  14. BrowserSettings.webgl = STATE_ENABLED;

    第三步:UE4\Engine\Source\Runtime\WebBrowser\Private\CEF\CEFBrowserApp.cpp
    OnBeforeCommandLineProcessing函数中添加
     
  15. CommandLine->AppendSwitchWithValue(
  16. "ppapi-flash-path",
  17. "C:\\UE4\\Engine\\Source\\ThirdParty\\CEF3\\pepflashplayer.dll");
  18. CommandLine->AppendSwitchWithValue("ppapi-flash-version", "26.0.0.131");
  19.  


注释:

1.0 貌似需要用源码版重新编译

2.0 pepflashplay.dll需要用30以下的版本,30以上英文版本貌似国内被和谐了,中文版没找到下载的地方

评论 12
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值