summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/qmediaplayer/mediaplayer.cpp8
-rw-r--r--demos/qmediaplayer/mediaplayer.h1
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);