2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Play streaming audio in player.

This commit is contained in:
John Preston
2019-03-01 01:03:25 +04:00
parent f1e0cd6c1d
commit fde8dd9607
44 changed files with 998 additions and 1445 deletions

View File

@@ -209,7 +209,9 @@ void Application::showPhoto(
}
void Application::showDocument(not_null<DocumentData*> document, HistoryItem *item) {
if (cUseExternalVideoPlayer() && document->isVideoFile()) {
if (cUseExternalVideoPlayer()
&& document->isVideoFile()
&& document->loaded()) {
QDesktopServices::openUrl(QUrl("file:///" + document->location(false).fname));
} else {
_mediaView->showDocument(document, item);
@@ -738,6 +740,11 @@ void Application::authSessionDestroy() {
if (_authSession) {
unlockTerms();
_mtproto->clearGlobalHandlers();
// Must be called before Auth().data() is destroyed,
// because streaming media holds pointers to it.
Media::Player::instance()->handleLogout();
_authSession = nullptr;
authSessionChanged().notify(true);
Notify::unreadCounterUpdated();