Plugin issue. How to load Flash/SL/PDF's ?

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

Plugin issue. How to load Flash/SL/PDF's ?

Postby MAHE202 » Sun Sep 08, 2013 12:11 am

Hi All,
Need your input regarding how to load the pdf's or any other plugin like Silver Light, Flash stuff in CEF Glue.

After going through this forum, I learned that we need to add those plugin through this function - CefRuntime.AddWebPluginDirectory but not sure what else I've to do.
I'm seeing black screen when I try to load the pdf's.

I think I've implemented Downloadhandler as well.. but not very sure what goes where...

In WPFCEFBrowser.cs I have code to add those plugins dir but don't see them loading the pdf's rightly.

protected override Size ArrangeOverride(Size arrangeBounds)
{
var size = base.ArrangeOverride(arrangeBounds);

if (_browserPageImage != null)
{
....
CefBrowserHost.CreateBrowser(windowInfo, _cefClient, settings, !string.IsNullOrEmpty(StartUrl) ? StartUrl : "about:blank");

CefRuntime.AddWebPluginDirectory(@"C:\Program Files\Microsoft Silverlight\5.1.20513.0\");
CefRuntime.AddWebPluginDirectory(@"C:\Program Files\Adobe\Reader 9.0\Reader\Browser");
CefRuntime.AddWebPluginDirectory(@"C:\Windows\system32\Macromed\Flash");

CefRuntime.RefreshWebPlugins();
.. . .
}

It would be grateful if some one gives pointers like steps to take care for loading this plugin based contents in a page.

thankz
MAHE202
Techie
 
Posts: 10
Joined: Wed Aug 28, 2013 6:05 am

Re: Plugin issue. How to load Flash/SL/PDF's ?

Postby fddima » Sun Sep 08, 2013 4:28 pm

Hi.

I think that in your's case CefRuntime.AddWebPluginDirectory must be called at program startup (from Main method).
Even while plugin configuration in runtime are allowed - you choose wrong place to do that.
By default flash plugin are correctly loaded, use cefclient / demo.winforms first for testing.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Plugin issue. How to load Flash/SL/PDF's ?

Postby MAHE202 » Mon Sep 09, 2013 9:46 am

Thanks for the reply. I tried at both the places and doesn't seem to be working.

On loading the url with PDF'- first i get an empty dialog box witout text and on clicking ok i see the screen(rendering area) going black.

But I see the process having the plugin path set rightly as an arguments and so on.

Copied the logs below.. pls see if you can..

[0909/201153:VERBOSE1:pref_proxy_config_tracker_impl.cc(145)] 048A0B40: set chrome proxy config service to 048A0900
[0909/201153:VERBOSE1:pref_proxy_config_tracker_impl.cc(235)] 048A0B40: Done pushing proxy to UpdateProxyConfig
[0909/201237:ERROR:renderer_main.cc(203)] Running without renderer sandbox
[0909/201237:VERBOSE1:resource_loader.cc(337)] OnResponseStarted: http://www.agr.state.il.us/farmersmarke ... Market.pdf
[0909/201237:VERBOSE1:resource_loader.cc(377)] OnReadCompleted: "http://www.agr.state.il.us/farmersmarket/MarketingTheMarket.pdf" bytes_read = 718
[0909/201237:VERBOSE1:resource_loader.cc(377)] OnReadCompleted: "http://www.agr.state.il.us/farmersmarket/MarketingTheMarket.pdf" bytes_read = 2048
[0909/201237:WARNING:content_browser_client.cc(358)] No browser info matching process id -1 and view id -2
[0909/201237:WARNING:content_browser_client.cc(358)] No browser info matching process id -1 and view id -2
[0909/201237:WARNING:content_browser_client.cc(358)] No browser info matching process id -1 and view id -2
[0909/201237:WARNING:content_browser_client.cc(358)] No browser info matching process id -1 and view id -2
[0909/201237:WARNING:content_browser_client.cc(358)] No browser info matching process id -1 and view id -2
[0909/201237:WARNING:content_browser_client.cc(358)] No browser info matching process id -1 and view id -2
[0909/201237:WARNING:content_browser_client.cc(358)] No browser info matching process id -1 and view id -2
[0909/201237:VERBOSE1:resource_loader.cc(377)] OnReadCompleted: "http://www.agr.state.il.us/farmersmarket/MarketingTheMarket.pdf" bytes_read = 4096
[0909/201237:VERBOSE1:resource_loader.cc(377)] OnReadCompleted: "http://www.agr.state.il.us/farmersmarket/MarketingTheMarket.pdf" bytes_read = 4088
[0909/201237:ERROR:ipc_channel_win.cc(132)] pipe error: 109
[0909/201239:VERBOSE1:resource_loader.cc(377)] OnReadCompleted: "http://www.agr.state.il.us/farmersmarket/MarketingTheMarket.pdf" bytes_read = 3752
[0909/201239:VERBOSE1:resource_loader.cc(377)] OnReadCompleted: "http://www.agr.state.il.us/farmersmarket/MarketingTheMarket.pdf" bytes_read = 3752
[0909/201239:VERBOSE1:resource_loader.cc(377)] OnReadCompleted: "http://www.agr.state.il.us/farmersmarket/MarketingTheMarket.pdf" bytes_read = 3752
[0909/201240:VERBOSE1:resource_loader.cc(337)] OnResponseStarted: http://www.agr.state.il.us/farmersmarke ... Market.pdf
[0909/201240:VERBOSE1:http_cache_transaction.cc(1715)] Invalid byte range found.

Thkx.
MAHE202
Techie
 
Posts: 10
Joined: Wed Aug 28, 2013 6:05 am

Re: Plugin issue. How to load Flash/SL/PDF's ?

Postby fddima » Mon Sep 09, 2013 10:04 am

Can you reproduce anything with cefclient (and adobe flash player installed). It must opens pdf using plugin.
I'm no have adobe flash player installed, so it just trying download pdf as raw file (cefclient ask for this).
Also you can grab plugin info with correspond CefRuntime method, to be sure that plugin are visible and will be used by cef.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: Plugin issue. How to load Flash/SL/PDF's ?

Postby MAHE202 » Mon Sep 09, 2013 10:58 am

Everthing loads fine with CEFClient. In fact it windows version also loads all these plugin easily (but don't see any single of code related to plugin in winforms sameple).

I see all these plugin loading and rendering easily in goog chrome where WPF CEF has got some issue which I'm not able to fix yet.

>>> Also you can grab plugin info with correspond CefRuntime method, to be sure that plugin are visible and will be used by cef.
How do i this..? any sample if you have..
MAHE202
Techie
 
Posts: 10
Joined: Wed Aug 28, 2013 6:05 am

Re: Plugin issue. How to load Flash/SL/PDF's ?

Postby fddima » Mon Sep 09, 2013 1:10 pm

MAHE202 wrote:Everthing loads fine with CEFClient. In fact it windows version also loads all these plugin easily (but don't see any single of code related to plugin in winforms sameple).
I see all these plugin loading and rendering easily in goog chrome where WPF CEF has got some issue which I'm not able to fix yet.
>>> Also you can grab plugin info with correspond CefRuntime method, to be sure that plugin are visible and will be used by cef.
How do i this..? any sample if you have..

When plugins installed - you don't need do anything special... For me, in past, it works fine.
WPF since it uses OSR, will require some other wmode (transparent, opaque, but not windowed).
Check CefRuntime.VisitWebPluginInfo method and that it outputs. In CefGlue.Demo.WinForms - flash for example should works.
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 26 guests