UE4 CEFBrowserApp.cpp里修改这些代码
void FCEFBrowserApp::OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine)
{
//加载Flash
FString ThePath = FPaths::ConvertRelativePathToFull(FPaths::RootDir()) + TEXT("Engine/Binaries/ThirdParty/CEF3/Win64/pepflashplayer.dll");
std::string MyStdString(TCHAR_TO_UTF8(*ThePath));
CefString cef_str(MyStdString);
CommandLine->AppendSwitchWithValue("ppapi-flash-path",cef_str);
CommandLine->AppendSwitchWithValue("ppapi-flash-version", "30.0.0.154");
//使用系统的Flash
/*CommandLine->AppendSwitch("--disable-web-security");
CommandLine->AppendSwitch("--enable-system-flash");*/
//使用单线程
//CommandLine->AppendSwitch("single-process");
CommandLine->AppendSwitch("enable-gpu");
CommandLine->AppendSwitch("enable-gpu-compositing");
#if !PLATFORM_MAC
CommandLine->AppendSwitch("enable-begin-frame-scheduling");
#endif
}
注意需要把Flash的Dll拷贝到相应的目录,使用64位Dll,使用中国特供版Flash dll 不然会出现你的dll在当前地区不可用的提示 然后强制停止
找到E:\UE4.19\Engine\Source\ThirdParty\CEF3\CEF3.build.cs
添加dll
Dlls.Add("pepflashplayer.dll");
t
WebBrowserSingleton.cpp里修改这些代码</