diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-10-21 14:53:03 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-10-21 14:54:45 (GMT) |
commit | bc2de3fbcc3f19c80938bdea17f01aa7da9f055e (patch) | |
tree | a4cd62affb92e474557beb5bc013cea4ed0ed7d5 | |
parent | b49e0184d29c25c99e7001cb1f50cae34423d706 (diff) | |
download | Qt-bc2de3fbcc3f19c80938bdea17f01aa7da9f055e.zip Qt-bc2de3fbcc3f19c80938bdea17f01aa7da9f055e.tar.gz Qt-bc2de3fbcc3f19c80938bdea17f01aa7da9f055e.tar.bz2 |
Listen on hasVideoChanged() instead of only checking hasVideo().
This means that when the backend's knowledge about the content's video
capability changes outside the LoadingState, it still work. This
apparently matters for the Helix backend. Patch supplied by Adookkattil
Saleem (Nokia-D/Dallas).
Reviewed-by: Gareth Stockwell
Reviewed-by: Frans Englich
-rw-r--r-- | demos/qmediaplayer/mediaplayer.cpp | 8 | ||||
-rw-r--r-- | demos/qmediaplayer/mediaplayer.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp index e1ceb0e..624bab7 100644 --- a/demos/qmediaplayer/mediaplayer.cpp +++ b/demos/qmediaplayer/mediaplayer.cpp @@ -321,6 +321,7 @@ MediaPlayer::MediaPlayer(const QString &filePath, connect(&m_MediaObject, SIGNAL(finished()), this, SLOT(finished())); connect(&m_MediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), this, SLOT(stateChanged(Phonon::State, Phonon::State))); connect(&m_MediaObject, SIGNAL(bufferStatus(int)), this, SLOT(bufferStatus(int))); + connect(&m_MediaObject, SIGNAL(hasVideoChanged(bool)), this, SLOT(hasVideoChanged(bool))); rewindButton->setEnabled(false); playButton->setEnabled(false); @@ -339,8 +340,6 @@ void MediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate) Q_UNUSED(oldstate); if (oldstate == Phonon::LoadingState) { - m_videoWindow.setVisible(m_MediaObject.hasVideo()); - info->setVisible(!m_MediaObject.hasVideo()); QRect videoHintRect = QRect(QPoint(0, 0), m_videoWindow.sizeHint()); QRect newVideoRect = QApplication::desktop()->screenGeometry().intersected(videoHintRect); if (!m_hasSmallScreen) { @@ -846,3 +845,8 @@ void MediaPlayer::aspectChanged(QAction *act) m_videoWidget->setAspectRatio(Phonon::VideoWidget::AspectRatioAuto); } +void MediaPlayer::hasVideoChanged(bool bHasVideo) +{ + info->setVisible(!bHasVideo); + m_videoWindow.setVisible(bHasVideo); +} diff --git a/demos/qmediaplayer/mediaplayer.h b/demos/qmediaplayer/mediaplayer.h index 40ffa40..83f14e8 100644 --- a/demos/qmediaplayer/mediaplayer.h +++ b/demos/qmediaplayer/mediaplayer.h @@ -93,6 +93,7 @@ public slots: void playPause(); void scaleChanged(QAction *); void aspectChanged(QAction *); + void hasVideoChanged(bool); private slots: void setAspect(int); |