Browser plugins do not load when implementing WebView

I have a Cocoa application that I am trying to write that displays a web page. This web page contains a built-in quartz composition in the background that plays and works when in Safari, but it displays in my Cocoa application (instead, it shows the missing plugin icon in the background).

It is strange that it works on another computer on which I tested it. Have I missed a framework or a plugin somewhere that can cause this?

Another note: plugins do not seem to work. For example, when the WebView displays youtube.com, it cannot play the video because it says that the Flash plugin is not installed. Again, the same code works on another computer, but not on this one.

Thanks! Any help would be greatly appreciated!

+4
source share
2 answers

You need to explicitly enable plugin support in WebView. You can do this in the Builder interface (check the Enable: plugins box) or in code by calling -setPluginsEnabled: in the web view of the WebPreferences object:

WebPreferences *prefs = [webView preferences]; [prefs setPlugInsEnabled:YES]; 

If you have plugins, make sure the plugins are compatible with the architecture / runtime that you create. If you are building an application with 64-bit or garbage, any WebKit plug-ins that you download must support the architecture. For example, the Flash plugin does not load into a GC-enabled application, although it loads into 64-bit because it is loaded into a 32-bit sandbox as an NPAPI plug.

+4
source

The strangest, only thing that worked was to build it on a test machine instead of the machine I was developing on. How strange!

0
source

All Articles