views:

271

answers:

2

I have a Cocoa app that I'm trying to write which displays a webpage. This webpage has an embedded quartz composition in the background that plays and works when in Safari, but it does show in my Cocoa application (it just shows the missing plugin icon in the background instead).

The weird thing is that it works on another computer that I was testing it on. Am I missing a framework or a plugin somewhere that might cause this?

Another note: no plug-ins seem to work. For example, when the WebView displays youtube.com it is unable to play video because it says that Flash Plugin is not installed. Again, the same code works on another computer, but not this one.

Thanks! Any help would be greatly appreciated!

+4  A: 

You need to explicitly enable plug-in support in the WebView. You can do this in Interface Builder (check the Enable: Plugins checkbox) or in code by calling -setPluginsEnabled: on the web view's WebPreferences object:

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

If you do have plug-ins enabled, check that the plug-ins are compatible with the architecture/runtime that you're creating. If you're building a 64-bit or Garbage-Collected app, any WebKit plug-ins you load must support the architecture. For instance, the Flash plug-in won't load in a GC-enabled app, although it loads in 64-bit because as an NPAPI plug it is loaded in a 32-bit sandbox.

Rob Keniger
Thanks so much for your response, but that didn't work either. I really thought it would though!I'm starting to think it might have nothing to do with the code, but perhaps the environment in which I am running the application. Because as I said earlier, it works fine on the computer that I'm actually writing the code on, but the computer that I'm testing it on is not working. Very strange!
Zanneth
What are the specs of the two machines? Is anything output to the console?
Rob Keniger
A: 

Strangest thing, the only thing that ended up working was to build it on the test machine instead of the machine that I was developing on. How strange!

Zanneth