X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/1b4572dac9fb529d31b786f93e4f02c6f8aeeb21..a06ee3399bece608790e419054f95807a017a020:/src/panels/information/phononwidget.cpp diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index 0de587bf8..215be200a 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -166,6 +166,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(); @@ -185,6 +191,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); @@ -201,16 +214,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) @@ -218,15 +222,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(); } }