check the properties are really changed
This commit is contained in:
parent
0a62e28dfd
commit
0b5cc4860f
@ -282,7 +282,18 @@ Phonon::AudioOutput *VideoWidget::audioOutput() const
|
||||
|
||||
void VideoWidget::setUrl(const QString &url)
|
||||
{
|
||||
d->media->setCurrentSource(Phonon::MediaSource(url));
|
||||
QString fileUrl;
|
||||
if (url.startsWith('/')) {
|
||||
fileUrl = "file://" % url;
|
||||
} else {
|
||||
fileUrl = url;
|
||||
}
|
||||
|
||||
if (fileUrl == d->media->currentSource().url().toString()) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->media->setCurrentSource(Phonon::MediaSource(fileUrl));
|
||||
}
|
||||
|
||||
QString VideoWidget::url() const
|
||||
@ -292,6 +303,10 @@ QString VideoWidget::url() const
|
||||
|
||||
void VideoWidget::setUsedControls(const Controls controls)
|
||||
{
|
||||
if (controls == d->shownControls) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->shownControls = controls;
|
||||
|
||||
//kDebug()<<"Setting used controls"<<controls;
|
||||
@ -465,21 +480,37 @@ VideoWidget::Controls VideoWidget::usedControls() const
|
||||
|
||||
void VideoWidget::play()
|
||||
{
|
||||
if (d->media->state() == Phonon::PlayingState) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->media->play();
|
||||
}
|
||||
|
||||
void VideoWidget::pause()
|
||||
{
|
||||
if (d->media->state() == Phonon::PausedState) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->media->pause();
|
||||
}
|
||||
|
||||
void VideoWidget::stop()
|
||||
{
|
||||
if (d->media->state() == Phonon::StoppedState) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->media->stop();
|
||||
}
|
||||
|
||||
void VideoWidget::seek(qint64 time)
|
||||
{
|
||||
if (d->media->currentTime() == time) {
|
||||
return;
|
||||
}
|
||||
|
||||
d->media->seek(time);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user