CefSharp3 AddWebPluginPath doesn't seem to work

359 views
Skip to first unread message

Michal Tsadok

unread,
Apr 29, 2015, 6:31:59 AM4/29/15
to cefs...@googlegroups.com
CefSharp3 code fails to set the plugin path

On a machine without Flash player installed, I'm getting Couldn't load plug-in. when trying to load flash content

This is the code that I've added 
[I took CefSharp3 from NuGet on April 27th 2015]
            Cef.AddWebPluginPath(Path.Combine(Directory.GetCurrentDirectory(), "NPSWF32_13_0_0_214.dll")); // Flash 13.0.0.214
            Cef.AddWebPluginPath(Path.Combine(Directory.GetCurrentDirectory(), "np-mswmp(1_0_0_8).dll")); // Windows Media Player 1.0.0.8
            Cef.RefreshWebPlugins();
[I also tried this relative path - @"./NPSWF32_13_0_0_214.dll" but no success]
I followed these guidelines

This code worked on CefSharp1
            var settings = new CefSharp.Settings();
            settings.AddPluginPath(@"./NPSWF32_13_0_0_214.dll"); // Flash 13.0.0.214
            settings.AddPluginPath(@"./np-mswmp(1_0_0_8).dll"); // Windows Media Player 1.0.0.8
            CEF.Initialize(settings);

Please advise
Thanks!
Michal

Alex Maitland

unread,
Apr 29, 2015, 6:10:01 PM4/29/15
to cefs...@googlegroups.com
You'll need to call those methods in the new Cef.OnContextInitialized delegate.

An example
https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Example/CefExample.cs#L79

This is relatively new and will be included as part of the upcoming `39.0.1` release

Reference http://magpcss.org/ceforum/viewtopic.php?f=11&t=11164&p=18980&hilit=CefAddWebPluginPath#p18980

Maikel Karnebeek

unread,
Apr 30, 2015, 4:55:19 AM4/30/15
to cefs...@googlegroups.com
Could you please provide a clear code example?

I can't get it working.

Op donderdag 30 april 2015 00:10:01 UTC+2 schreef Alex Maitland:

Alex Maitland

unread,
Apr 30, 2015, 5:44:29 AM4/30/15
to cefs...@googlegroups.com
Nope, no sample exists. Never used this feature. We're in uncharted territory.

What does your code look like?

Michal Tsadok

unread,
Apr 30, 2015, 8:59:44 AM4/30/15
to cefs...@googlegroups.com
Alex,

Thanks!!
When 39.0.1 is planned to be released?

Michal

Jørn Hansen

unread,
Apr 30, 2015, 9:24:49 AM4/30/15
to cefs...@googlegroups.com
Hi Michal,

I see it's been tagged 13 hours ago - https://github.com/cefsharp/CefSharp/releases/tag/v39.0.1

The binaries/NuGet have not been pushed to NuGet.org yet as far as I can tell. Until that happens you can grab them from the CI build at https://www.myget.org/gallery/cefsharp 

--
Best  Regards,
JornH

Maikel Karnebeek

unread,
Apr 30, 2015, 9:29:09 AM4/30/15
to cefs...@googlegroups.com
            Cef.OnContextInitialized = delegate
           
{
               
Cef.AddWebPluginPath(@"C:\Windows\System32\Macromed\Flash\Flash.ocx");
               
Cef.AddWebPluginPath(@"C:\Program Files\Microsoft Silverlight\5.1.30514.0\npctrl.dll");
               
Cef.SetCookiePath("cookies", true);
           
};
           
Cef.RefreshWebPlugins();


Op donderdag 30 april 2015 11:44:29 UTC+2 schreef Alex Maitland:

Alex Maitland

unread,
Apr 30, 2015, 9:37:22 AM4/30/15
to cefs...@googlegroups.com
Cef.RefreshWebPlugins() should be called after the two calls to `Cef.AddWebPluginPath()`

Alex Maitland

unread,
Apr 30, 2015, 9:38:45 AM4/30/15
to cefs...@googlegroups.com
The packages just need a few more eyes over them before being pushed to Nuget.org

Hopefully in the next day or two if all goes well.

Michal Tsadok

unread,
Apr 30, 2015, 9:51:25 AM4/30/15
to cefs...@googlegroups.com
Thanks to all of you

I'll wait for the NuGet package and put the RefreshWebPlugin within the OnContextInitialized 

Cheers
Michal

Michal Tsadok

unread,
May 7, 2015, 5:03:56 AM5/7/15
to cefs...@googlegroups.com
Works!!!

Thanks :)

Alex Maitland

unread,
May 7, 2015, 5:07:53 AM5/7/15
to cefs...@googlegroups.com
Great. Thanks for reporting back.

I'll add the code as an example, was this what you ended up with?

Cef.OnContextInitialized = delegate
{
  Cef.AddWebPluginPath(@"C:\Windows\System32\Macromed\Flash\Flash.ocx");
 
Cef.AddWebPluginPath(@"C:\Program Files\Microsoft Silverlight\5.1.30514.0\npctrl.dll");
  Cef.RefreshWebPlugins();
};

Maikel Karnebeek

unread,
May 8, 2015, 4:26:18 AM5/8/15
to cefs...@googlegroups.com
Somehow I can't get this working correctly. 

Silverlight is not rendering. It is loading though.
I am not sure about Flash or Java.

But it should be the correct way to do it.


Op donderdag 7 mei 2015 11:07:53 UTC+2 schreef Alex Maitland:

Alex Maitland

unread,
May 8, 2015, 4:43:51 AM5/8/15
to cefs...@googlegroups.com
Silverlight in `WPF`? There's a known problem https://github.com/cefsharp/CefSharp/issues/467
Reply all
Reply to author
Forward
0 new messages