PauseMusicPlugin now stops music when it can't pause (ie: streams)
This commit is contained in:
parent
6549da84be
commit
400cff1c9c
1 changed files with 6 additions and 2 deletions
|
@ -98,7 +98,11 @@ bool PauseMusicPlugin::receivePackage(const NetworkPackage& np)
|
||||||
if (status == "Playing") {
|
if (status == "Playing") {
|
||||||
if (!pausedSources.contains(iface)) {
|
if (!pausedSources.contains(iface)) {
|
||||||
pausedSources.insert(iface);
|
pausedSources.insert(iface);
|
||||||
mprisInterface.asyncCall("Pause");
|
if (mprisInterface.property("CanPause").toBool()) {
|
||||||
|
mprisInterface.asyncCall("Pause");
|
||||||
|
} else {
|
||||||
|
mprisInterface.asyncCall("Stop");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,7 +122,7 @@ bool PauseMusicPlugin::receivePackage(const NetworkPackage& np)
|
||||||
//mprisInterface->call(QDBus::Block,"Play");
|
//mprisInterface->call(QDBus::Block,"Play");
|
||||||
//Workaround: Using playpause instead (checking first if it is already playing)
|
//Workaround: Using playpause instead (checking first if it is already playing)
|
||||||
QString status = mprisInterface.property("PlaybackStatus").toString();
|
QString status = mprisInterface.property("PlaybackStatus").toString();
|
||||||
if (status == "Paused") mprisInterface.asyncCall("PlayPause");
|
mprisInterface.asyncCall("PlayPause");
|
||||||
//End of workaround
|
//End of workaround
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue