]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/information/phononwidget.cpp
SVN_SILENT made messages (after extraction)
[dolphin.git] / src / panels / information / phononwidget.cpp
index a36ada180126c6d84452aa43720d59c94b9ef82a..63f5aa3a591d241767e94cf051a4016e458905ee 100644 (file)
@@ -165,6 +165,12 @@ void PhononWidget::stateChanged(Phonon::State newstate)
         m_stopButton->show();
         m_playButton->hide();
         break;
+    case Phonon::StoppedState:
+        if (m_videoPlayer) {
+            m_videoPlayer->hide();
+        }
+        emit hasVideoChanged(false);
+        // fall through
     default:
         m_stopButton->hide();
         m_playButton->show();
@@ -184,6 +190,13 @@ void PhononWidget::play()
         m_seekSlider->setMediaObject(m_media);
     }
 
+    if (!m_videoPlayer) {
+        m_videoPlayer = new EmbeddedVideoPlayer(this);
+        m_topLayout->insertWidget(0, m_videoPlayer);
+        Phonon::createPath(m_media, m_videoPlayer);
+        applyVideoSize();
+    }
+
     if (!m_audioOutput) {
         m_audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
         Phonon::createPath(m_media, m_audioOutput);
@@ -200,16 +213,7 @@ void PhononWidget::stop()
 {
     if (m_media) {
         m_media->stop();
-
-        m_stopButton->hide();
-        m_playButton->show();
     }
-
-    if (m_videoPlayer) {
-        m_videoPlayer->hide();
-    }
-
-    emit hasVideoChanged(false);
 }
 
 void PhononWidget::slotHasVideoChanged(bool hasVideo)
@@ -217,15 +221,6 @@ void PhononWidget::slotHasVideoChanged(bool hasVideo)
     emit hasVideoChanged(hasVideo);
 
     if (hasVideo) {
-        if (!m_videoPlayer) {
-            // Replay the media to apply path changes
-            m_media->stop();
-            m_videoPlayer = new EmbeddedVideoPlayer(this);
-            m_topLayout->insertWidget(0, m_videoPlayer);
-            Phonon::createPath(m_media, m_videoPlayer);
-            m_media->play();
-        }
-        applyVideoSize();
         m_videoPlayer->show();
     }
 }