Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Display bug with WebKit / HTML object video and Qt::WA_TranslucentBackground

Display bug with WebKit / HTML object video and Qt::WA_TranslucentBackground

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 2 Posters 3.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EmmanuelVerlynde
    wrote on last edited by
    #1

    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(&#41;;
    

    }

    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>
    @

    1 Reply Last reply
    0
    • D Offline
      D Offline
      darktears
      wrote on last edited by
      #2

      It is not supported. You perhaps will be able to do it with the upcoming version of QtWebKit, the HTML5 audio element and QtMultimedia.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved