Fixed update of availability of next and previous tracks in SMC.

This commit is contained in:
23rd 2021-06-08 04:14:54 +03:00
parent c6fde48936
commit 2f0fd398d5
1 changed files with 7 additions and 0 deletions

View File

@ -163,6 +163,13 @@ SystemMediaControlsManager::SystemMediaControlsManager(
_lastAudioMsgId = current;
}, _lifetime);
mediaPlayer->playlistChanges(
type
) | rpl::start_with_next([=] {
_controls->setIsNextEnabled(mediaPlayer->nextAvailable(type));
_controls->setIsPreviousEnabled(mediaPlayer->previousAvailable(type));
}, _lifetime);
_controls->commandRequests(
) | rpl::start_with_next([=](Command command) {
switch (command) {