#include <KDialog>
#include <QIcon>
#include <KIconLoader>
-#include <KUrl>
-#include <KLocale>
+#include <QUrl>
+#include <KLocalizedString>
class EmbeddedVideoPlayer : public Phonon::VideoWidget
{
{
}
-void PhononWidget::setUrl(const KUrl &url)
+void PhononWidget::setUrl(const QUrl &url)
{
if (m_url != url) {
stop(); // emits playingStopped() signal
}
}
-KUrl PhononWidget::url() const
+QUrl PhononWidget::url() const
{
return m_url;
}
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();
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);
{
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)
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();
}
}