Enable CEF3 pepper flash plugin

How can you activate the pepper flash plugin for the WebBrowser widget?
I’m changing Engine\Source\Runtime\WebBrowser\Private\WebBrowserSingleton.cpp
after

CEFBrowserApp = new FCEFBrowserApp;

i’m adding:

FCommandLine::Append(TEXT(" --enable-system-flash=1 "));

but i don’t see it working, maybe i copied the file pepflashplayer.dll in the wrong place? : Engine\Source\ThirdParty\CEF3

i think the other way to do this is :

CefRefPtr<CefCommandLine> command_line = CefCommandLine::CreateCommandLine();
command_line->AppendSwitchWithValue("ppapi-flash-path", "pepflashplayer.dll");
command_line->AppendSwitchWithValue("ppapi-flash-version", "24.0 r0");
command_line->AppendSwitchWithValue("plugin-policy", "allow");

do you know how to do it?

You are accessing the command line correctly but you are using the parameters in a wrong way.
If you want to compile the engine with flash support, download the pepper flash dll or use the one in your chrome (or chromium) browser and copy it to a local folder, then ,go to
UE4\Engine\Source\Runtime\WebBrowser\Private\CEF\CEFBrowserApp.cpp
and in the OnBeforeCommandLineProcessing function ,add this

CommandLine->AppendSwitchWithValue(
		"ppapi-flash-path",
		"C:\\UE4\\Engine\\Source\\ThirdParty\\CEF3\\pepflashplayer.dll");
CommandLine->AppendSwitchWithValue("ppapi-flash-version", "24.0.0.186");

use your own path and flash version for your case, compile and run, you will have flash in your project. Ah, in the same function you have the gpu disable option ,that’s for webgl.

chers

Ah, of course you also need to enable things in WebBrowserSingleton.cpp like:
CefRefPtr command_line = CefCommandLine::CreateCommandLine();

command_line->AppendSwitchWithValue("ppapi-flash-path", "pepflashplayer.dll");
command_line->AppendSwitchWithValue("ppapi-flash-version", "24.0 r0");
command_line->AppendSwitchWithValue("plugin-policy", "allow");
command_line->AppendSwitchWithValue("enable-system-flash", "1");
//...
FCommandLine::Append(TEXT(" --enable-system-flash=1 --plugin-policy=allow "));
 //...
Settings.no_sandbox = false;
Settings.command_line_args_disabled = false;
//...
// Enable plugins
BrowserSettings.plugins = STATE_ENABLED;
BrowserSettings.webgl = STATE_ENABLED;

You also need to modify WebBrowserSinleton.cpp …
in the constructor:

CEFBrowserApp = new FCEFBrowserApp;
	CefRefPtr<CefCommandLine> command_line = CefCommandLine::CreateCommandLine();
	command_line->AppendSwitchWithValue("ppapi-flash-path", "pepflashplayer.dll");
	command_line->AppendSwitchWithValue("ppapi-flash-version", "24.0 r0");
	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;
//...

in the createbrowserwindow function:

BrowserSettings.plugins = STATE_ENABLED;
BrowserSettings.webgl = STATE_ENABLED;

Hi, juanbelon.alea

I want to display a webgl page, and I added two lines in the createbrowserwindow function:

BrowserSettings.plugins = STATE_ENABLED;
BrowserSettings.webgl = STATE_ENABLED;

I still can’t display webgl page, it says: your browser not support webgl.

Did I miss something there? Did you test it?

Other issue, I can load a PDF file, but the webbrowser not refresh well, it flashing badly and seems the performance is very low. How to fix it?

Thanks!

Dear XIXGAMES:

Thank you very much. And it works eventually.

:smiley:

Does anybody know if this still works in UE 4.20?