How to play flash with JCEF

Having problems with building or using the JCEF Java binding? Ask your questions here.

How to play flash with JCEF

Postby WeiLi » Mon Aug 28, 2017 10:00 am

I have Swing embedded browser application which is implemented using JCEF, it does not play flash, how to make it support flash? The following is my code. My system is Windows 10
CefSettings settings = new CefSettings();
settings.cache_path="d:/cefCache";
String[] args={
// "--ppapi-flash-path=\"C:\\Users\\wei\\AppData\\Local\\Google\\Chrome\\User Data\\PepperFlash\\26.0.0.151\\pepflashplayer.dll\"",
// "--ppapi-flash-version=26.0.0.151",
"--enable-system-flash=true",
"--plugin-policy=allow"
};
String startURL="http://saizenmedia.com/fubon/";
// String startURL="http://192.168.86.27:8086/?name=keno";
CefApp cefApp = CefApp.getInstance(args,settings);
CefClient client = cefApp.createClient();
CefBrowser browser = client.createBrowser(startURL, false, false);
Component browerUI = browser.getUIComponent();
JTextField address = new JTextField(startURL, 100);
address.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
browser.loadURL(address.getText());
}
});
getContentPane().add(address, BorderLayout.NORTH);
getContentPane().add(browerUI, BorderLayout.CENTER);
pack();
setSize(800,600);
setVisible(true);
WeiLi
Newbie
 
Posts: 3
Joined: Mon Aug 28, 2017 9:43 am

Re: How to play flash with JCEF

Postby magreenblatt » Mon Aug 28, 2017 12:12 pm

Install the "Opera and Chromium PPAPI" version from https://get.adobe.com/flashplayer/otherversions/ and then run CEF with the `--enable-system-flash` command-line flag.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: How to play flash with JCEF

Postby WeiLi » Tue Aug 29, 2017 9:09 am

magreenblatt wrote:Install the "Opera and Chromium PPAPI" version from https://get.adobe.com/flashplayer/otherversions/ and then run CEF with the `--enable-system-flash` command-line flag.


I do have "Opera and Chromium PPAPI" version flash installed
I have downloaded the builds from here http://opensource.spotify.com/cefbuilds/index.html
The flash is playing fine when I use cefclient.exe with "--enable-system-flash"

But Java is my language of choice for my application, hence JCEF. It seems the flag "--enable-system-flash" is lost between JCEF and CEF.
Any suggestion?
WeiLi
Newbie
 
Posts: 3
Joined: Mon Aug 28, 2017 9:43 am

Re: How to play flash with JCEF

Postby WeiLi » Tue Aug 29, 2017 12:51 pm

The problem was the following code which was not posted. It works fine once I replaced the null with args

Code: Select all
CefApp.addAppHandler(new CefAppHandlerAdapter(null) {
        @Override
        public void stateHasChanged(org.cef.CefApp.CefAppState state) {
            if (state == CefAppState.TERMINATED){
                System.exit(0);
            }
        }
    });
WeiLi
Newbie
 
Posts: 3
Joined: Mon Aug 28, 2017 9:43 am


Return to JCEF Forum

Who is online

Users browsing this forum: No registered users and 16 guests