1

我正在使用 QWebView 来显示聊天记录。

webView = new QWebView(this);
QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
webView->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
webView->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
webView->settings()->setMaximumPagesInCache(0);
webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);

如果未设置 QWebView 的代理,则这样的 HTML 代码可以正常工作。

<iframe width=\"100%\" height=\"315\" frameborder=\"0\" allowfullscreen src=\"http://www.youtube.com/embed/" + rxYouTube.cap(11) + "\" ></iframe>

但是当我做这样的事情时

QNetworkProxy proxy;
proxy.setType(QNetworkProxy::HttpProxy);
proxy.setHostName("_ip_");
proxy.setPort(_port_);
proxy.setUser("_login_");
proxy.setPassword("_passsword_");
QNetworkProxy::setApplicationProxy(proxy);

YouTube 告诉我我的浏览器不支持 HTML5。

我该如何解决这个问题?

PS平台:Qt 4.8、Windows、VC

4

1 回答 1

0

I haven't tested going through a proxy yet, although my LAN uses a transparent auto-proxy so at least that much works, but I have worked out how to get general HTML5 Video support in a QWebView on Windows. I've written a blog post about that you can read here: http://blog.enthought.com/open-source/fun-with-qtwebkit-html5-video/ It involves building Qt + qt-mobility, and also a bug fix in qt-mobility.

于 2013-04-01T22:18:04.530 回答