2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Added play button for recorded voice data.

This commit is contained in:
23rd
2020-11-10 16:52:17 +03:00
committed by John Preston
parent 7826d0246d
commit 5eba680483
3 changed files with 136 additions and 7 deletions

View File

@@ -483,7 +483,7 @@ void MainWidget::floatPlayerClosed(FullMsgId itemId) {
const auto voiceData = Media::Player::instance()->current(
AudioMsgId::Type::Voice);
if (voiceData.contextId() == itemId) {
_player->entity()->stopAndClose();
stopAndClosePlayer();
}
}
}
@@ -882,6 +882,12 @@ void MainWidget::closeBothPlayers() {
Shortcuts::ToggleMediaShortcuts(false);
}
void MainWidget::stopAndClosePlayer() {
if (_player) {
_player->entity()->stopAndClose();
}
}
void MainWidget::createPlayer() {
if (!_player) {
_player.create(