Flash player
ibrahemesam opened this issue · 13 comments
How can I enable flash player in CEF au3
Hi,
First, you need sync cefau3 source and rebuild it (or put autoit3/cefau3/*
& release/cefau3.dll
to your program).
- Implement
OnBeforeCommandLineProcessing
fromCefApp
$cef_app.OnBeforeCommandLineProcessing = __OBCLP
func __OBCLP($process_type, $command_line)
end
- Enable plugins support via
CefBrowserSettings
$browser_settings.plugins = 1
$browser_settings.webgl = 1 ; enable webGL
- Setup flash player
- Download flash plugin library (.dll), click here or search pepflashplayer.dll on Google. For exmaple, I download
pepflashplayer.dll
(32bit - v23.0.0.162) and put it inC:\pepflashplayer.dll
. - On
__OBCLP
function, add following code:
...
$command_line.AppendSwitch(' --enable-system-flash=1 ')
$command_line.AppendSwitchWithValue('ppapi-flash-path', 'C:\\pepflashplayer.dll')
$command_line.AppendSwitchWithValue('ppapi-flash-version', '23.0.0.162')
$command_line.AppendSwitchWithValue('plugin-policy', 'allow')
sorry for my late
I did as you say
`$cef_app.OnBeforeCommandLineProcessing = __OBCLP
$browser_settings.plugins = 1
$browser_settings.webgl = 1 ; enable webGL
func __OBCLP($process_type, $command_line)
$command_line.AppendSwitch(' --enable-system-flash=1 ')
$command_line.AppendSwitchWithValue('ppapi-flash-path', @ScriptDir '\pepflashplayer.dll')
$command_line.AppendSwitchWithValue('ppapi-flash-version', '28.0.0.137')
$command_line.AppendSwitchWithValue('plugin-policy', 'allow')
EndFunc `
I think $browser_settings
is not declared or it is not an object, so you cannot invoke dispatch.
global $browser_settings = $cef.new("BrowserSettings")
You can see that.
Are you using the latest Cefau3 version?
The previous version is not supported pre-commandline processing.
First, you need sync cefau3 source and rebuild it (or put
autoit3/cefau3/*
&release/cefau3.dll
to your program).
Yes
My program folder contains :
cefau3 (folder)
cefau3.dll (file)
The script.au3 (file)
is that right ?
Please check two files $(repo)/release/
cefau3.dll
and your cefau3.dll
.
Is it one?
btw
AutoIt bindings is my failure, that is so low and bad performance, I cannot continue to develop this project. I'm so sorry about that.
Okay, please try my binaries here (only for x86, I tested on Windows 7 and 10 32bit & 64bit).
In your code, $browser_settings
is not linked to app, so you cannot enable flashplayer (if it works).
If this code is from example.au3, you can see $cef.CreateBrowser
, at #param4, that is BrowserSettings
.
#Region init flash player
$cef_app.OnBeforeCommandLineProcessing = __OBCLP
$cef_bs.plugins = 1
$cef_bs.webgl = 1 ; enable webGL
func __OBCLP($process_type, $command_line)
$command_line.AppendSwitch(' --enable-system-flash=1 ')
$command_line.AppendSwitchWithValue('ppapi-flash-path', @ScriptDir & '\pepflashplayer.dll')
$command_line.AppendSwitchWithValue('ppapi-flash-version', '25.0.0.171')
$command_line.AppendSwitchWithValue('plugin-policy', 'allow')
endfunc
#EndRegion
global $url = 'https://www.google.com/'
$cef.CreateBrowser($cef_wininfo.__ptr, $cef_client.__ptr, $url, $cef_bs.__ptr, Null)
global $cef_browser_hwnd = 0
OnAutoItExitRegister('CefExit')
CefWndMsg_RunLoop(0)
Cefau3 is not stable, and flash is a third party, it maybe crash. You must run example on compiled executable.
Please try this.
$cef_app.OnBeforeCommandLineProcessing = __OBCLP ; set commandline processing before init app
$cef.Initialize(...) ; /////////////////////
...
#Region init flash player
$cef_bs.plugins = 1
$cef_bs.webgl = 1 ; enable webGL
func __OBCLP($process_type, $command_line)
$command_line = CefCommandLine_Create($command_line) ; create commandline object
$command_line.AppendSwitch(' --type=ppapi --enable-system-flash=1 ')
$command_line.AppendSwitchWithValue('ppapi-flash-path', 'C:\pepflashplayer.dll')
$command_line.AppendSwitchWithValue('ppapi-flash-version', '25.0.0.171')
$command_line.AppendSwitchWithValue('plugin-policy', 'allow')
endfunc
#EndRegion
...
global $url = 'https://google.com'
$cef.CreateBrowser($cef_wininfo.__ptr, $cef_client.__ptr, $url, $cef_bs.__ptr, Null)
...
This line is from example, $cef_app.OnBeforeCommandLineProcessing
must be set above this line.