mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Fixed track change notification in media player.
This commit is contained in:
@@ -129,6 +129,11 @@ SystemMediaControlsManager::SystemMediaControlsManager(
|
|||||||
if (!current) {
|
if (!current) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ((_lastAudioMsgId.contextId() == current.contextId())
|
||||||
|
&& (_lastAudioMsgId.audio() == current.audio())
|
||||||
|
&& (_lastAudioMsgId.type() == current.type())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const auto document = current.audio();
|
const auto document = current.audio();
|
||||||
|
|
||||||
const auto &[title, performer] = Ui::Text::FormatSongNameFor(document)
|
const auto &[title, performer] = Ui::Text::FormatSongNameFor(document)
|
||||||
@@ -156,6 +161,8 @@ SystemMediaControlsManager::SystemMediaControlsManager(
|
|||||||
} else {
|
} else {
|
||||||
_controls->clearThumbnail();
|
_controls->clearThumbnail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_lastAudioMsgId = current;
|
||||||
}, _lifetime);
|
}, _lifetime);
|
||||||
|
|
||||||
_controls->commandRequests(
|
_controls->commandRequests(
|
||||||
|
@@ -32,6 +32,7 @@ private:
|
|||||||
const std::unique_ptr<base::Platform::SystemMediaControls> _controls;
|
const std::unique_ptr<base::Platform::SystemMediaControls> _controls;
|
||||||
|
|
||||||
std::vector<std::shared_ptr<Data::DocumentMedia>> _cachedMediaView;
|
std::vector<std::shared_ptr<Data::DocumentMedia>> _cachedMediaView;
|
||||||
|
AudioMsgId _lastAudioMsgId;
|
||||||
|
|
||||||
rpl::lifetime _lifetimeDownload;
|
rpl::lifetime _lifetimeDownload;
|
||||||
rpl::lifetime _lifetime;
|
rpl::lifetime _lifetime;
|
||||||
|
Reference in New Issue
Block a user