montoyo / mcef

Minecraft ChromiumEF (based on JCEF)
Other
191 stars 83 forks source link

As someone who uses flash, I'd like the ability to enable the --enable-system-flash option #21

Closed binary1230 closed 4 years ago

binary1230 commented 7 years ago

Hi! Big fan of the mod + WebDisplays.

I was using this mod in conjunction with a specific low latency flash-based video player to show a livestream of another game (kerbal space program) inside Minecraft and then was displaying it inside minecraft (https://www.youtube.com/watch?v=JW55HgpsaYI if you're curious, long story)

This was all working great until it stopped working for seemingly no reason. Now, flash players are ignored inside MCEF. normally when it can't run flash you see a grey box that says "plugin is not installed", I was only getting this error message in the logs whenever trying to access a page with flash on it:

[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: java.lang.NoClassDefFoundError: org/cef/handler/CefFocusHandler$FocusSource
[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]: Caused by: java.lang.ClassNotFoundException: org.cef.handler.CefFocusHandler$FocusSource
[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:     at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:     at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:     at java.security.AccessController.doPrivileged(Native Method)
[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:     at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[12:51:22] [Thread-19/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:748]:     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Using minecraft 1.7.10, MCEF 0.6, Webdisplays 0.11.

I tried a zillion combos of installing various versions of Flash, both NPAPI, Chromium/opera version, older versions, etc. no dice. I did notice that Chrome these days refuses to run the external flash plugin (latest chrome is on Chromium 55 or something), and the one MCEF is using is Chromium 33 or so.

I started digging into the code messing around with CEF's test apps and found they also refused to play flash, unless I started the test CEF client application with --enable-system-flash option which loads the external flash player plugin. I was looking for a way to enable that command line option via config in Minecraft+MCEF+WebDisplays but it appears there isn't a way to do that currently.

In the underlying CEF C++ library, --enable-system-flash maps to command_line->HasSwitch(switches::kEnableSystemFlash)). I think through JCEF it's accessible via a class called CefSettings (didn't get to dig much further).

It would be really cool if in future realeases, this was an option that could be set via mcef.cfg. If I can get things compiling here I might dive in and try to add it (it's so annoying that I need flash for the particular project I'm doing)

montoyo commented 5 years ago

Maybe adding --enable-system-flash to JCEF's command line argument would do the job... do you have a link or something where I could test this?

Thanks.

montoyo commented 4 years ago

Hi. I've added an option in the mcef config file to add custom command line arguments to pass to CEF. Tell me if it changed anything...