2013-02-07 21 views
1

我正在使用QWebView來顯示聊天記錄。QWebview,HTTP代理,html5視頻不起作用

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

回答

0

我沒有測試通過代理去的是,雖然我的LAN使用透明的自動代理,以便至少這麼多的作品,但我已經摸索出如何在Windows上的QWebView中獲得常規的HTML5視頻支持。我寫了一篇關於你可以在這裏閱讀的博客文章:http://blog.enthought.com/open-source/fun-with-qtwebkit-html5-video/它涉及到構建Qt + qt-mobility,也是qt-mobility中的一個錯誤修復。