问题描述
安装了最新的Flash播放器并启用了插件,我的简单示例可以播放youtube视频
With latest Flash player installed, and enable the Plugins, my simple example can play youtube videos
操作系统:windows 7
OS: windows 7
Qt:4.7.4(32和64位都有效)
Qt: 4.7.4 (both 32 & 64bit works)
但是,根据http://www.youtube.com/html5 ,我的示例浏览器支持视频标签和H.264,我想知道为什么我不能像往常一样禁用插件并播放视频?我遵循了在YouTube的HTML5播放器中观看视频的流程。
However, according to "http://www.youtube.com/html5", my example browser supports "Video tag" and "H.264", I was wondering why can't I just DISABLE the Plugins and play the video as usual? I have followed the procedure of " Watch a Video in YouTube's HTML5 Player"http://googlesystem.blogspot.com/2010/08/watch-video-in-youtubes-html5-player.html
但根本不工作〜
这是我的代码:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
QWebView *view = new QWebView();
view->load(QUrl("http://www.youtube.com/watch?v=cTl3U6aSd2w&html5=True"));
view->show();
return a.exec();
}
是否缺少任何代码或我应该启用其他任何代码?
Is there any code missing or I should enable anything else?
谢谢。
推荐答案
我写了一篇关于我如何为我们的项目解决这个问题的博文。它涉及构建Qt + qt-mobility,以及qt-mobility中的错误修复。请参见
I've written a blog post about how I've solved this issue for our project. It involves building Qt + qt-mobility, and also a bug fix in qt-mobility. See http://blog.enthought.com/open-source/fun-with-qtwebkit-html5-video/
这篇关于QtWebKit播放HTML5视频而无需安装Flash播放器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!