Display bug with WebKit / HTML object video and Qt::WA_TranslucentBackground
-
Dear All,
I search a solution to solve my problem of video / webkit and transparent window.
I display a video in the WebView which is include into a MainWindow.
All is ok except if i put the window background transparent... Here, the video do not display but i could click on and listen the audio.
Did someone has already encountered this problem and found any solution?
Thanks.
QT 4.6.3 with QT Creator 1.3.1 (compiler from MSVC2008 Standard and libraries/frameworks compiled statically)
@
main.cpp#include <QApplication>
#include <QtWebKit/QWebSettings>
#include <QtWebKit/QWebView>
#include <QMainWindow>
#include <QUrl>
#include <QtCore/QtPlugin>Q_IMPORT_PLUGIN(qjpeg)
Q_IMPORT_PLUGIN(qgif)int main(int argc, char *argv[])
{
QApplication a(argc, argv);QWebSettings::globalSettings()->clearMemoryCaches(); QWebSettings::setMaximumPagesInCache(0); QWebSettings::setObjectCacheCapacities(0, 0, 0); QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true); QMainWindow * window = new QMainWindow(); window->setWindowModality(Qt::NonModal); window->setWindowFlags(Qt::FramelessWindowHint); window->setWindowTitle("myapplication"); window->setAttribute(Qt::WA_TranslucentBackground, true); window->setAutoFillBackground(false); QWebView * view = new QWebView(window); view->setAttribute(Qt::WA_TranslucentBackground, false); view->setAttribute(Qt::WA_OpaquePaintEvent, true); view->load(QUrl("mov.html")); window->setCentralWidget(view); window->show(); return a.exec();
}
myapplication.pro
SOURCES += main.cpp
CONFIG += static
QT += webkit
QTPLUGIN += qgif qjpeg
QMAKE_LFLAGS_DEBUG += /NODEFAULTLIB:msvcrt
LIBS += "C:NokiaQt4.6.3pluginsimageformatsqjpeg.lib" "C:NokiaQt4.6.3pluginsimageformatsqgif.lib"mov.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html >
<head>
<title>XHTML Quicktime Object</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="811" height="455">
<param name="src" value="http://.../video.mp4" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<object type="video/quicktime" data="http://.../video.mp4" class="mov" width="811" height="455">
<param name="controller" value="true" />
<param name="autoplay" value="false" />
Error text.
</object>
</object>
</body>
</html>
@