pythongoflashchromium-embedded

White Screen When Loading Flash Plugin with CEF in GoLang


I am developing a desktop application using Energy (a GUI framework for Go based on LCL and CEF (Chromium Embedded Framework), used for developing cross-platform desktop applications for Windows, macOS, and Linux). When I enable the Flash plugin in CEF and load a webpage that uses Flash, it results in a white screen.screenshot

    cef.GlobalInit(nil, nil)
    cefApp := cef.NewApplication()
    cef.BrowserWindow.Config.Url = "http://seer.61.com/play.shtml"
    config := cef.NewChromiumConfig()

    config.SetEnableMenu(false)
    config.SetEnableDevTools(false)
    config.SetEnabledJavascript(true)
    cef.BrowserWindow.Config.SetChromiumConfig(config)

    eh := os.Getenv("ENERGY_HOME")
    if eh == "" {
        eh = consts.ExeDir
    }

    cefApp.AddCustomCommandLine("ppapi-flash-path", filepath.Join(eh, "pepflashplayer.dll"))
    cefApp.AddCustomCommandLine("ppapi-flash-version", "99.0.0.000")
    cefApp.AddCustomCommandLine("allow-outdated-plugins", "")
    cefApp.AddCustomCommandLine("disable-gpu", "")
    cefApp.SetOnBeforeChildProcessLaunch(func(commandLine *cef.ICefCommandLine) {

        commandLine.AppendSwitch("--allow-outdated-plugins")
        commandLine.AppendSwitch("--disable-web-security")
        commandLine.AppendSwitch("enable-system-flash")
    })

Notably, when I use the same parameters and the Flash plugin DLL to access certain webpages that require Flash support, they run normally. I suspect there might be an issue with the Energy framework, but I also tried with cefpython and encountered the same white screen problem. However, when I use Electron and load the same pepflashplayer, there are no issues.

How can I solve the white screen problem in Energy?

If you need further assistance or want me to provide a more structured question or troubleshooting steps, please let me know!


Solution

  • After setting a cache path, it worked!