From bc2de3fbcc3f19c80938bdea17f01aa7da9f055e Mon Sep 17 00:00:00 2001 From: Frans Englich Date: Wed, 21 Oct 2009 16:53:03 +0200 Subject: 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 --- demos/qmediaplayer/mediaplayer.cpp | 8 ++++++-- 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); -- cgit v0.12