Changeset 75944 in webkit


Ignore:
Timestamp:
Jan 17, 2011 8:00:31 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-01-17 Yi Shen <yi.4.shen@nokia.com>

Reviewed by Andreas Kling.

[Qt] Extend the Platform Plugin to support full screen video handler
https://bugs.webkit.org/show_bug.cgi?id=51249

Make MediaPlayerPrivateQt support a fullscreen player.

No new tests because LayoutTests/media/media-fullscreen-inline.html already exists.
However, this test failed for Qt (QtMediaPlayer) due to durationchange event getting fired twice.
So, still skip it for Qt.

  • WebCore.pro:
  • features.pri:
  • platform/graphics/qt/MediaPlayerPrivateQt.cpp: (WebCore::MediaPlayerPrivateQt::MediaPlayerPrivateQt): (WebCore::MediaPlayerPrivateQt::removeVideoItem): (WebCore::MediaPlayerPrivateQt::restoreVideoItem):
  • platform/graphics/qt/MediaPlayerPrivateQt.h: (WebCore::MediaPlayerPrivateQt::supportsFullscreen): (WebCore::MediaPlayerPrivateQt::mediaPlayer):

2011-01-17 Yi Shen <yi.4.shen@nokia.com>

Reviewed by Andreas Kling.

[Qt] Extend the Platform Plugin to support full screen video handler
https://bugs.webkit.org/show_bug.cgi?id=51249

Add a new webkit platform plugin interface to support full screen video handler.

  • Api/qwebkitplatformplugin.h: (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler): (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler):
  • WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::ChromeClientQt): (WebCore::ChromeClientQt::~ChromeClientQt): (WebCore::ChromeClientQt::fullScreenVideo): (WebCore::ChromeClientQt::supportsFullscreenForNode): (WebCore::ChromeClientQt::requiresFullscreenForVideoPlayback): (WebCore::ChromeClientQt::enterFullscreenForNode): (WebCore::ChromeClientQt::exitFullscreenForNode):
  • WebCoreSupport/ChromeClientQt.h:
  • WebCoreSupport/FullScreenVideoQt.cpp: Added. (WebCore::FullScreenVideoQt::FullScreenVideoQt): (WebCore::FullScreenVideoQt::~FullScreenVideoQt): (WebCore::FullScreenVideoQt::enterFullScreenForNode): (WebCore::FullScreenVideoQt::exitFullScreenForNode): (WebCore::FullScreenVideoQt::aboutToClose): (WebCore::FullScreenVideoQt::mediaPlayer): (WebCore::FullScreenVideoQt::mediaPlayerForNode): (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback):
  • WebCoreSupport/FullScreenVideoQt.h: Added. (WebCore::FullScreenVideoQt::isValid):
  • WebCoreSupport/QtPlatformPlugin.cpp: (WebCore::QtPlatformPlugin::createFullScreenVideoHandler):
  • WebCoreSupport/QtPlatformPlugin.h:
  • examples/platformplugin/WebPlugin.cpp: (FullScreenVideoWidget::FullScreenVideoWidget): (FullScreenVideoWidget::event): (FullScreenVideoWidget::keyPressEvent): (FullScreenVideoHandler::FullScreenVideoHandler): (FullScreenVideoHandler::~FullScreenVideoHandler): (FullScreenVideoHandler::requiresFullScreenForVideoPlayback): (FullScreenVideoHandler::enterFullScreen): (FullScreenVideoHandler::exitFullScreen): (WebPlugin::supportsExtension): (WebPlugin::createExtension):
  • examples/platformplugin/WebPlugin.h: (FullScreenVideoWidget::~FullScreenVideoWidget):
  • examples/platformplugin/platformplugin.pro:
  • examples/platformplugin/qwebkitplatformplugin.h: (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler): (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler):
Location:
trunk/Source
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r75940 r75944  
     12011-01-17  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] Extend the Platform Plugin to support full screen video handler
     6        https://bugs.webkit.org/show_bug.cgi?id=51249
     7
     8        Make MediaPlayerPrivateQt support a fullscreen player.
     9
     10        No new tests because LayoutTests/media/media-fullscreen-inline.html already exists.
     11        However, this test failed for Qt (QtMediaPlayer) due to durationchange event getting fired twice.
     12        So, still skip it for Qt.
     13
     14        * WebCore.pro:
     15        * features.pri:
     16        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
     17        (WebCore::MediaPlayerPrivateQt::MediaPlayerPrivateQt):
     18        (WebCore::MediaPlayerPrivateQt::removeVideoItem):
     19        (WebCore::MediaPlayerPrivateQt::restoreVideoItem):
     20        * platform/graphics/qt/MediaPlayerPrivateQt.h:
     21        (WebCore::MediaPlayerPrivateQt::supportsFullscreen):
     22        (WebCore::MediaPlayerPrivateQt::mediaPlayer):
     23
    1242011-01-17  Anthony Ricaud  <rik@webkit.org>
    225
  • trunk/Source/WebCore/WebCore.pro

    r75908 r75944  
    32583258        PKGCONFIG += glib-2.0 gio-2.0 gstreamer-0.10 gstreamer-app-0.10 gstreamer-base-0.10 gstreamer-interfaces-0.10 gstreamer-pbutils-0.10 gstreamer-plugins-base-0.10 gstreamer-video-0.10
    32593259     } else:contains(MOBILITY_CONFIG, multimedia) {
    3260         HEADERS += platform/graphics/qt/MediaPlayerPrivateQt.h
    3261         SOURCES += platform/graphics/qt/MediaPlayerPrivateQt.cpp
     3260        HEADERS += \
     3261            platform/graphics/qt/MediaPlayerPrivateQt.h \
     3262            $$PWD/../../WebKit/qt/WebCoreSupport/FullScreenVideoQt.h
     3263
     3264        SOURCES += \
     3265            platform/graphics/qt/MediaPlayerPrivateQt.cpp \
     3266            $$PWD/../../WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp
    32623267
    32633268        CONFIG *= mobility
  • trunk/Source/WebCore/features.pri

    r75206 r75944  
    153153        DEFINES -= ENABLE_VIDEO=0
    154154        DEFINES += ENABLE_VIDEO=1
     155        DEFINES -= ENABLE_QT_MULTIMEDIA=0
     156        DEFINES += ENABLE_QT_MULTIMEDIA=1
    155157    } else:contains(QT_CONFIG, phonon) {
    156158        DEFINES -= ENABLE_VIDEO=0
    157159        DEFINES += ENABLE_VIDEO=1
     160        DEFINES -= ENABLE_QT_MULTIMEDIA=1
     161        DEFINES += ENABLE_QT_MULTIMEDIA=0
    158162    }
    159163}
  • trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp

    r75885 r75944  
    109109    , m_preload(MediaPlayer::Auto)
    110110{
    111     m_mediaPlayer->bind(m_videoItem);
     111    m_mediaPlayer->setVideoOutput(m_videoItem);
    112112    m_videoScene->addItem(m_videoItem);
    113113
     
    588588}
    589589
     590void MediaPlayerPrivateQt::removeVideoItem()
     591{
     592    m_oldNaturalSize = m_naturalSize;
     593    m_mediaPlayer->setVideoOutput(static_cast<QGraphicsVideoItem*>(0));
     594    m_videoScene->removeItem(m_videoItem);
     595}
     596
     597void MediaPlayerPrivateQt::restoreVideoItem()
     598{
     599    m_mediaPlayer->setVideoOutput(m_videoItem);
     600    m_videoScene->addItem(m_videoItem);
     601    // FIXME: a qtmobility bug, need to reset the size when restore the videoitem, otherwise the size is 0
     602    // http://bugreports.qt.nokia.com/browse/QTMOBILITY-971
     603    nativeSizeChanged(QSize(m_oldNaturalSize));
     604}
     605
    590606void MediaPlayerPrivateQt::paint(GraphicsContext* context, const IntRect& rect)
    591607{
  • trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h

    r75885 r75944  
    9191    void paint(GraphicsContext*, const IntRect&);
    9292
    93     bool supportsFullscreen() const { return false; }
     93    bool supportsFullscreen() const { return true; }
    9494
    9595#if USE(ACCELERATED_COMPOSITING)
     
    109109
    110110    virtual PlatformMedia platformMedia() const;
     111
     112    QMediaPlayer* mediaPlayer() const { return m_mediaPlayer; }
     113    void removeVideoItem();
     114    void restoreVideoItem();
     115
    111116private slots:
    112117    void mediaStatusChanged(QMediaPlayer::MediaStatus);
     
    143148    IntSize m_currentSize;
    144149    IntSize m_naturalSize;
     150    IntSize m_oldNaturalSize;
    145151    bool m_isVisible;
    146152    bool m_isSeeking;
  • trunk/Source/WebKit/qt/Api/qwebkitplatformplugin.h

    r75885 r75944  
    2929#include <QObject>
    3030#include <QUrl>
     31#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     32#include <QMediaPlayer>
     33#endif
    3134
    3235class QWebSelectData
     
    116119};
    117120
     121#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     122class QWebFullScreenVideoHandler : public QObject {
     123    Q_OBJECT
     124public:
     125    QWebFullScreenVideoHandler() {}
     126    virtual ~QWebFullScreenVideoHandler() {}
     127    virtual bool requiresFullScreenForVideoPlayback() const = 0;
     128
     129Q_SIGNALS:
     130    void fullScreenClosed();
     131
     132public Q_SLOTS:
     133    virtual void enterFullScreen(QMediaPlayer*) = 0;
     134    virtual void exitFullScreen() = 0;
     135};
     136#endif
     137
    118138class QWebKitPlatformPlugin
    119139{
     
    125145        Notifications,
    126146        Haptics,
    127         TouchInteraction
     147        TouchInteraction,
     148        FullScreenVideoPlayer
    128149    };
    129150
     
    133154
    134155QT_BEGIN_NAMESPACE
    135 Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.6");
     156Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.7");
    136157QT_END_NAMESPACE
    137158
  • trunk/Source/WebKit/qt/ChangeLog

    r75908 r75944  
     12011-01-17  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [Qt] Extend the Platform Plugin to support full screen video handler
     6        https://bugs.webkit.org/show_bug.cgi?id=51249
     7
     8        Add a new webkit platform plugin interface to support full screen video handler.
     9
     10        * Api/qwebkitplatformplugin.h:
     11        (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler):
     12        (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler):
     13        * WebCoreSupport/ChromeClientQt.cpp:
     14        (WebCore::ChromeClientQt::ChromeClientQt):
     15        (WebCore::ChromeClientQt::~ChromeClientQt):
     16        (WebCore::ChromeClientQt::fullScreenVideo):
     17        (WebCore::ChromeClientQt::supportsFullscreenForNode):
     18        (WebCore::ChromeClientQt::requiresFullscreenForVideoPlayback):
     19        (WebCore::ChromeClientQt::enterFullscreenForNode):
     20        (WebCore::ChromeClientQt::exitFullscreenForNode):
     21        * WebCoreSupport/ChromeClientQt.h:
     22        * WebCoreSupport/FullScreenVideoQt.cpp: Added.
     23        (WebCore::FullScreenVideoQt::FullScreenVideoQt):
     24        (WebCore::FullScreenVideoQt::~FullScreenVideoQt):
     25        (WebCore::FullScreenVideoQt::enterFullScreenForNode):
     26        (WebCore::FullScreenVideoQt::exitFullScreenForNode):
     27        (WebCore::FullScreenVideoQt::aboutToClose):
     28        (WebCore::FullScreenVideoQt::mediaPlayer):
     29        (WebCore::FullScreenVideoQt::mediaPlayerForNode):
     30        (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback):
     31        * WebCoreSupport/FullScreenVideoQt.h: Added.
     32        (WebCore::FullScreenVideoQt::isValid):
     33        * WebCoreSupport/QtPlatformPlugin.cpp:
     34        (WebCore::QtPlatformPlugin::createFullScreenVideoHandler):
     35        * WebCoreSupport/QtPlatformPlugin.h:
     36        * examples/platformplugin/WebPlugin.cpp:
     37        (FullScreenVideoWidget::FullScreenVideoWidget):
     38        (FullScreenVideoWidget::event):
     39        (FullScreenVideoWidget::keyPressEvent):
     40        (FullScreenVideoHandler::FullScreenVideoHandler):
     41        (FullScreenVideoHandler::~FullScreenVideoHandler):
     42        (FullScreenVideoHandler::requiresFullScreenForVideoPlayback):
     43        (FullScreenVideoHandler::enterFullScreen):
     44        (FullScreenVideoHandler::exitFullScreen):
     45        (WebPlugin::supportsExtension):
     46        (WebPlugin::createExtension):
     47        * examples/platformplugin/WebPlugin.h:
     48        (FullScreenVideoWidget::~FullScreenVideoWidget):
     49        * examples/platformplugin/platformplugin.pro:
     50        * examples/platformplugin/qwebkitplatformplugin.h:
     51        (QWebFullScreenVideoHandler::QWebFullScreenVideoHandler):
     52        (QWebFullScreenVideoHandler::~QWebFullScreenVideoHandler):
     53
    1542011-01-16  Adam Barth  <abarth@webkit.org>
    255
  • trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp

    r75885 r75944  
    7777#include <wtf/OwnPtr.h>
    7878
     79#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     80#include "FullScreenVideoQt.h"
     81#include "HTMLMediaElement.h"
     82#include "HTMLNames.h"
     83#include "HTMLVideoElement.h"
     84#include "MediaPlayerPrivateQt.h"
     85#endif
     86
    7987namespace WebCore {
    8088
     
    8492    : m_webPage(webPage)
    8593    , m_eventLoop(0)
     94#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     95    , m_fullScreenVideo(0)
     96#endif
    8697{
    8798    toolBarsVisible = statusBarVisible = menuBarVisible = true;
     
    92103    if (m_eventLoop)
    93104        m_eventLoop->exit();
     105
     106#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     107    delete m_fullScreenVideo;
     108#endif
    94109}
    95110
     
    649664#endif
    650665
     666#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     667FullScreenVideoQt* ChromeClientQt::fullScreenVideo()
     668{
     669    if (!m_fullScreenVideo)
     670        m_fullScreenVideo = new FullScreenVideoQt(this);
     671    return m_fullScreenVideo;
     672}
     673
     674bool ChromeClientQt::supportsFullscreenForNode(const Node* node)
     675{
     676    ASSERT(node);
     677    return node->hasTagName(HTMLNames::videoTag) && fullScreenVideo()->isValid();
     678}
     679
     680bool ChromeClientQt::requiresFullscreenForVideoPlayback()
     681{
     682    return fullScreenVideo()->requiresFullScreenForVideoPlayback();
     683}
     684
     685void ChromeClientQt::enterFullscreenForNode(Node* node)
     686{
     687    ASSERT(node && node->hasTagName(HTMLNames::videoTag));
     688
     689    HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node);
     690    PlatformMedia platformMedia = videoElement->platformMedia();
     691
     692    ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType);
     693    if (platformMedia.type != PlatformMedia::QtMediaPlayerType)
     694        return;
     695
     696    fullScreenVideo()->enterFullScreenForNode(node);
     697}
     698
     699void ChromeClientQt::exitFullscreenForNode(Node* node)
     700{
     701    ASSERT(node && node->hasTagName(HTMLNames::videoTag));
     702
     703    HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node);
     704    PlatformMedia platformMedia = videoElement->platformMedia();
     705
     706    ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType);
     707    if (platformMedia.type != PlatformMedia::QtMediaPlayerType)
     708        return;
     709
     710    fullScreenVideo()->exitFullScreenForNode(node);
     711}
     712#endif
     713
    651714QWebSelectMethod* ChromeClientQt::createSelectPopup() const
    652715{
  • trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r75885 r75944  
    5151    class QtAbstractWebPopup;
    5252    struct ViewportArguments;
     53#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     54    class FullScreenVideoQt;
     55#endif
    5356
    5457    class ChromeClientQt : public ChromeClient
     
    163166        virtual void needTouchEvents(bool) { }
    164167#endif
     168 
     169#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     170        virtual bool supportsFullscreenForNode(const Node*);
     171        virtual void enterFullscreenForNode(Node*);
     172        virtual void exitFullscreenForNode(Node*);
     173        virtual bool requiresFullscreenForVideoPlayback();
     174        FullScreenVideoQt* fullScreenVideo();
     175#endif
    165176
    166177        virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
     
    197208        QEventLoop* m_eventLoop;
    198209
     210#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     211        FullScreenVideoQt* m_fullScreenVideo;
     212#endif
     213
    199214        static bool dumpVisitedLinksCallbacks;
    200215
  • trunk/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp

    r75885 r75944  
    128128}
    129129
     130#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     131QWebFullScreenVideoHandler* QtPlatformPlugin::createFullScreenVideoHandler()
     132{
     133    QWebKitPlatformPlugin* p = plugin();
     134    return p ? static_cast<QWebFullScreenVideoHandler*>(p->createExtension(QWebKitPlatformPlugin::FullScreenVideoPlayer)) : 0;
    130135}
     136#endif
     137
     138}
  • trunk/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h

    r75885 r75944  
    3030class QWebSelectData;
    3131class QWebTouchModifier;
     32#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     33class QWebFullScreenVideoHandler;
     34#endif
    3235
    3336namespace WebCore {
     
    4245    QWebHapticFeedbackPlayer* createHapticFeedbackPlayer();
    4346    QWebTouchModifier* createTouchModifier();
     47#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA)
     48    QWebFullScreenVideoHandler* createFullScreenVideoHandler();
     49#endif
    4450
    4551    QWebKitPlatformPlugin* plugin();
  • trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp

    r75885 r75944  
    2020#include "WebPlugin.h"
    2121
     22#include <QEvent>
    2223#include <QHBoxLayout>
     24#include <QKeyEvent>
    2325#include <QListWidget>
    2426#include <QListWidgetItem>
     
    209211}
    210212
     213#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     214FullScreenVideoWidget::FullScreenVideoWidget(QMediaPlayer* player)
     215    : QVideoWidget()
     216    , m_mediaPlayer(player)
     217{
     218    Q_ASSERT(m_mediaPlayer);
     219
     220    setFullScreen(true);
     221    m_mediaPlayer->setVideoOutput(this);
     222}
     223
     224bool FullScreenVideoWidget::event(QEvent* ev)
     225{
     226    if (ev->type() ==  QEvent::MouseButtonDblClick) {
     227        emit fullScreenClosed();
     228        ev->accept();
     229        return true;
     230    }
     231    return QWidget::event(ev);
     232}
     233
     234void FullScreenVideoWidget::keyPressEvent(QKeyEvent* ev)
     235{
     236    if (ev->key() == Qt::Key_Space) {
     237        if (m_mediaPlayer->state() == QMediaPlayer::PlayingState)
     238            m_mediaPlayer->pause();
     239        else
     240            m_mediaPlayer->play();
     241        ev->accept();
     242        return;
     243    }
     244}
     245
     246FullScreenVideoHandler::FullScreenVideoHandler()
     247    : m_mediaWidget(0)
     248{
     249}
     250
     251FullScreenVideoHandler::~FullScreenVideoHandler()
     252{
     253    delete m_mediaWidget;
     254}
     255
     256bool FullScreenVideoHandler::requiresFullScreenForVideoPlayback() const
     257{
     258    return true;
     259}
     260
     261void FullScreenVideoHandler::enterFullScreen(QMediaPlayer* player)
     262{
     263    Q_ASSERT(player);
     264
     265    m_mediaWidget = new FullScreenVideoWidget(player);
     266    connect(m_mediaWidget, SIGNAL(fullScreenClosed()), this, SIGNAL(fullScreenClosed()));
     267    m_mediaWidget->showFullScreen();
     268}
     269
     270void FullScreenVideoHandler::exitFullScreen()
     271{
     272    m_mediaWidget->hide();
     273    delete m_mediaWidget;
     274    m_mediaWidget = 0;
     275}
     276#endif
     277
    211278bool WebPlugin::supportsExtension(Extension extension) const
    212279{
     
    220287    case TouchInteraction:
    221288        return true;
     289#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     290    case FullScreenVideoPlayer:
     291        return true;
     292#endif
    222293    default:
    223294        return false;
     
    236307    case TouchInteraction:
    237308        return new TouchModifier();
     309#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     310    case FullScreenVideoPlayer:
     311        return new FullScreenVideoHandler();
     312#endif
    238313    default:
    239314        return 0;
  • trunk/Source/WebKit/qt/examples/platformplugin/WebPlugin.h

    r75885 r75944  
    2525
    2626#include <QDialog>
     27#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     28#include <QVideoWidget>
     29#endif
    2730
    2831class QListWidgetItem;
     
    9598};
    9699
     100#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     101class FullScreenVideoWidget : public QVideoWidget {
     102    Q_OBJECT
     103public:
     104    FullScreenVideoWidget(QMediaPlayer*);
     105    virtual ~FullScreenVideoWidget() {}
     106
     107Q_SIGNALS:
     108    void fullScreenClosed();
     109
     110protected:
     111    bool event(QEvent*);
     112    void keyPressEvent(QKeyEvent*);
     113
     114private:
     115    QMediaPlayer* m_mediaPlayer; // not owned
     116};
     117
     118class FullScreenVideoHandler : public QWebFullScreenVideoHandler {
     119    Q_OBJECT
     120public:
     121    FullScreenVideoHandler();
     122    virtual ~FullScreenVideoHandler();
     123    bool requiresFullScreenForVideoPlayback() const;
     124
     125public Q_SLOTS:
     126    void enterFullScreen(QMediaPlayer*);
     127    void exitFullScreen();
     128
     129private:
     130    FullScreenVideoWidget* m_mediaWidget; // owned
     131};
     132#endif
     133
    97134class WebPlugin : public QObject, public QWebKitPlatformPlugin
    98135{
  • trunk/Source/WebKit/qt/examples/platformplugin/platformplugin.pro

    r75885 r75944  
    33TEMPLATE = lib
    44CONFIG += plugin
     5
     6## load mobilityconfig if mobility is available
     7load(mobilityconfig, true)
     8
     9# HTML5 Media Support
     10# We require QtMultimedia
     11!contains(DEFINES, ENABLE_VIDEO=.) {
     12    contains(MOBILITY_CONFIG, multimedia) {
     13        CONFIG += mobility
     14        MOBILITY += multimedia
     15        DEFINES -= ENABLE_VIDEO=0
     16        DEFINES += ENABLE_VIDEO=1
     17        DEFINES -= ENABLE_QT_MULTIMEDIA=0
     18        DEFINES += ENABLE_QT_MULTIMEDIA=1
     19    }
     20}
    521
    622DESTDIR = $$[QT_INSTALL_PLUGINS]/webkit
  • trunk/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h

    r75885 r75944  
    2929#include <QObject>
    3030#include <QUrl>
     31#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     32#include <QMediaPlayer>
     33#endif
    3134
    3235class QWebSelectData
     
    116119};
    117120
     121#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
     122class QWebFullScreenVideoHandler : public QObject {
     123    Q_OBJECT
     124public:
     125    QWebFullScreenVideoHandler() {}
     126    virtual ~QWebFullScreenVideoHandler() {}
     127    virtual bool requiresFullScreenForVideoPlayback() const = 0;
     128
     129Q_SIGNALS:
     130    void fullScreenClosed();
     131
     132public Q_SLOTS:
     133    virtual void enterFullScreen(QMediaPlayer*) = 0;
     134    virtual void exitFullScreen() = 0;
     135};
     136#endif
     137
    118138class QWebKitPlatformPlugin
    119139{
     
    125145        Notifications,
    126146        Haptics,
    127         TouchInteraction
     147        TouchInteraction,
     148        FullScreenVideoPlayer
    128149    };
    129150
     
    133154
    134155QT_BEGIN_NAMESPACE
    135 Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.6");
     156Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.7");
    136157QT_END_NAMESPACE
    137158
Note: See TracChangeset for help on using the changeset viewer.