X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/07721cf76459d8fff9b96ffe3dde83bc418bed31..76a7ab4bffe7af84b96caf65bf43b7ee96b4e0c8:/src/panels/information/phononwidget.cpp diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index a36ada180..63f5aa3a5 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -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(); } }