CEF and Chromium "click to play"

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF and Chromium "click to play"

Postby amitkanfer » Mon Jul 21, 2014 4:22 am

Hi there experts,
i'm new to the CEF project, and perhaps this question had been already answered (although i couldn't find it online), so i apologize in advance if this is really the case.

I want to build an off-screen browser, and to have the chromium's "click-to-play" feature enabled by default, so all flash parts won't be visible at first view.
i looked at Peter Beverloo's site (http://peter.sh/experiments/chromium-command-line-switches/), which contains all command line switched - but there is no such switch in the list.

So... my questions are:
1. Is there any option to set the "click to play" feature from command line?
2. if there is such option - how do we do it from CEF?
3. if there is no such option - i can perhaps write the javascript code to do it externally - but then how do i load it into the chromium (via CEF)..?

thanks a lot guys,
Amit.
amitkanfer
Techie
 
Posts: 31
Joined: Mon Jul 21, 2014 4:10 am

Re: CEF and Chromium "click to play"

Postby magreenblatt » Tue Jul 29, 2014 9:34 am

amitkanfer wrote:1. Is there any option to set the "click to play" feature from command line?

No.
amitkanfer wrote:3. if there is no such option - i can perhaps write the javascript code to do it externally - but then how do i load it into the chromium (via CEF)..?

You could cancel the Flash plugin load using CefRequestHandler::OnBeforePluginLoad and then use ExecuteJavaScript to run some JavaScript that scans the DOM and replaces <object> and <embed> tags with buttons. Pressing the button would set some internal state so that OnBeforePluginLoad allows the Flash plugin to load the 2nd time. See https://code.google.com/p/chromiumembed ... ntegration for ideas on how to make the button work.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CEF and Chromium "click to play"

Postby wudijimao » Mon Jun 13, 2016 9:17 pm

Actually, we have command-line to set this:

command_line->AppendSwitchWithValue("plugin-policy", "allow");

See detail at this web page:https://bitbucket.org/chromiumembedded/cef/issues/1708/add-support-for-plugin-placeholders-and
wudijimao
Newbie
 
Posts: 5
Joined: Tue Jun 07, 2016 11:29 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 36 guests