Click here to Skip to main content
15,921,454 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi All,
I am trying to play .mp4 file in QWebView of Qt using HTML5 video support(I can not use any plugin or adobe flash).
I have 3 system. newly installed Windows 7 x64, Mac OS X 10.7 and Windows xp X64.
I get new Qt 5.0 for windows and Mac and installed on all systems. I have also installed full VLC (for codec) on all 3 system. Then i create a Qt program as below.

C++
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QWebView view;
    QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
    view.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    QUrl url("http://www.html5test.com"); // html5test.com is site to check which features of html5 your browser supports.
    view.load(url);
    view.show();
    return a.exec();
}

What i see is On windows 7 and Mac OS X gives that video and audio tag supported, and also MP4 video format supported on both os. But it shows 0 rating on windows xp x64 for video tag support. I google for this but could not get anything helpful. Why it says that video and audio tag not supported on Windows xp X64?

After that i try to load a website having different videos with
HTML
<video>
tag as below.

C++
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();
    QWebView view;
    QWebSettings::globalSettings()-&gt;setAttribute(QWebSettings::PluginsEnabled, true);
    view.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    QUrl url("http://shapeshed.com/examples/HTML5-video-element/");// having video tags
    view.load(url);
    view.show();
    return a.exec();
}



When i run above code, On Mac it run as per required. On windows 7 It shows the video controls (Play button, seek bar ) but it could not play video. And on Windows xp X64 machine no video and video control visible.
Whats Wrong with windows 7 machine if it says that video tag and mp4( and H.264) is supported?
I have other browsers too on all system where all above works nicely.
Is there any system specific settings required? or did I miss any important step(s)?
Thanks all.
Posted
Updated 10-Jan-13 2:41am
v3

1 solution

I seems that QApplication very depends on QT framework but not your browser.
I am now open page by using QApplication by python language, it work for png,html,text and anyother format, but where I try to load ogg sound, the QApplication and QWebView seems not work.
Also then, on my computer, the same os of course, I used chrome to open that page, it did has sound,and sound loaded js event emitted.

I really suffer on this problem too. I wish I could figure out the solution very soon
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900