diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp index dd4b6e6..be6f732 100644 --- a/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp +++ b/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp @@ -108,7 +108,7 @@ MediaPlayerPrivateQt::MediaPlayerPrivateQt(MediaPlayer* player) , m_queuedSeek(-1) , m_preload(MediaPlayer::Auto) { - m_mediaPlayer->bind(m_videoItem); + m_mediaPlayer->setVideoOutput(m_videoItem); m_videoScene->addItem(m_videoItem); // Signal Handlers @@ -587,6 +587,22 @@ IntSize MediaPlayerPrivateQt::naturalSize() const return m_naturalSize; } +void MediaPlayerPrivateQt::removeVideoItem() +{ + m_oldNaturalSize = m_naturalSize; + m_mediaPlayer->setVideoOutput(static_cast<QGraphicsVideoItem*>(0)); + m_videoScene->removeItem(m_videoItem); +} + +void MediaPlayerPrivateQt::restoreVideoItem() +{ + m_mediaPlayer->setVideoOutput(m_videoItem); + m_videoScene->addItem(m_videoItem); + // FIXME: a qtmobility bug, need to reset the size when restore the videoitem, otherwise the size is 0 + // http://bugreports.qt.nokia.com/browse/QTMOBILITY-971 + nativeSizeChanged(QSize(m_oldNaturalSize)); +} + void MediaPlayerPrivateQt::paint(GraphicsContext* context, const IntRect& rect) { #if USE(ACCELERATED_COMPOSITING) |