Click here to Skip to main content
12,898,392 members (55,276 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ QT HTML5 QT-Creator
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.

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(""); // is site to check which features of html5 your browser supports.
    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
tag as below.

int main(int argc, char *argv[])
    QApplication a(argc, argv);
    MainWindow w;;
    QWebView view;
    QWebSettings::globalSettings()-&gt;setAttribute(QWebSettings::PluginsEnabled, true);
    view.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
    QUrl url("");// having video tags
    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 10-Jan-13 2:32am
Updated 10-Jan-13 2:41am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 15 Mar 2015
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100