cocoa使用WebView加载swf文件

时间:2012-10-04 06:45:57

标签: macos cocoa webkit flash

我使用webview在Mac OS X中加载SWF文件,但它注意到“Missing Plug-in”。

这是我的代码:

NSString *htmlString = [NSString stringWithFormat:@"<html><body style='overflow:hide;'><object width=\"344\" height=\"298\"><param name=\"movie\" value=\"%@\"<embed type=\"application/x-shockwave-flash\" src=\"%@\" width=\"344\" height=\"298\"/></body></html>", flashLink, flashLink];
[[webView mainFrame]loadHTMLString:htmlString baseURL:nil];
WebPreferences *prefs = [vwWeb preferences];
[prefs setPlugInsEnabled:YES];

如何加载此swf?

1 个答案:

答案 0 :(得分:0)

通过更改其他网页视图的偏好设置,我不知道您在做什么,但在加载此页面之前尝试更改您的偏好设置

NSString *htmlString = //Your string here
[[webView preferences] setPlugInsEnabled:YES];
[[webView mainFrame] loadHTMLString:htmlString baseURL:nil];
相关问题