翻译:https://answers.unrealengine.com/questions/544321/enable-cef3-pepper-flash-plugin.html
第一步:Engine\Source\Runtime\WebBrowser\Private\WebBrowserSingleton.cpp
- CEFBrowserApp = new FCEFBrowserApp; //在这句话后面添加如下内容
- CefRefPtr<CefCommandLine> command_line = CefCommandLine::CreateCommandLine();
- command_line->AppendSwitchWithValue("ppapi-flash-path", "pepflashplayer.dll");
- command_line->AppendSwitchWithValue("ppapi-flash-version", "26.0 r0");//根据你自己的flash版本
- command_line->AppendSwitchWithValue("plugin-policy", "allow");
- command_line->AppendSwitchWithValue("enable-system-flash", "1");
- FCommandLine::Append(TEXT(" --enable-system-flash=1 --plugin-policy=allow "));
- CEFBrowserApp->OnRenderProcessThreadCreated().BindRaw(this, &FWebBrowserSingleton::HandleRenderProcessCreated);
- //....
- Settings.no_sandbox = false;
- Settings.command_line_args_disabled = false;
第二步:createbrowserwindow函数中添加 - BrowserSettings.plugins = STATE_ENABLED;
- BrowserSettings.webgl = STATE_ENABLED;
第三步:UE4\Engine\Source\Runtime\WebBrowser\Private\CEF\CEFBrowserApp.cpp
OnBeforeCommandLineProcessing函数中添加
- CommandLine->AppendSwitchWithValue(
- "ppapi-flash-path",
- "C:\\UE4\\Engine\\Source\\ThirdParty\\CEF3\\pepflashplayer.dll");
- CommandLine->AppendSwitchWithValue("ppapi-flash-version", "26.0.0.131");
注释:
1.0 貌似需要用源码版重新编译
2.0 pepflashplay.dll需要用30以下的版本,30以上英文版本貌似国内被和谐了,中文版没找到下载的地方