【问题标题】:QWebview, HTTP proxy, html5 video does not workQWebview、HTTP 代理、html5 视频不起作用
【发布时间】:2013-02-07 08:26:34
【问题描述】:

我正在使用 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

【问题讨论】:

    标签: proxy html5-video qtwebkit qwebview


    【解决方案1】:

    我还没有测试通过代理,虽然我的 LAN 使用透明的自动代理,所以至少有这么多的工作,但我已经研究了如何在 Windows 上的 QWebView 中获得一般的 HTML5 视频支持。我写了一篇关于你可以在这里阅读的博客文章:http://blog.enthought.com/open-source/fun-with-qtwebkit-html5-video/ 它涉及构建 Qt + qt-mobility,以及 qt-mobility 中的错误修复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-12
      • 2016-07-02
      • 2015-10-19
      • 2013-08-23
      • 2018-04-01
      • 2016-02-23
      • 2012-12-21
      • 1970-01-01
      相关资源
      最近更新 更多