cocoa 使用 WebView 加载 SWF 文件



我使用 webview 在 Mac OS X 中加载 SWF 文件,但它注意到"缺少插件"。

这是我的代码:

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?

我不知道

您通过更改另一个 Web 视图的首选项在做什么,但是在加载这样的页面之前尝试更改您的首选项

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

最新更新