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

Allow float video player across accounts.

This commit is contained in:
John Preston
2020-06-25 18:17:37 +04:00
parent 8171ed6c12
commit bf7aae5fc6
38 changed files with 257 additions and 176 deletions

View File

@@ -71,6 +71,10 @@ class Instance;
namespace View {
class OverlayWidget;
} // namespace View
namespace Player {
class FloatController;
class FloatDelegate;
} // namespace Player
} // namespace Media
namespace Lang {
@@ -218,6 +222,15 @@ public:
bool openLocalUrl(const QString &url, QVariant context);
bool openInternalUrl(const QString &url, QVariant context);
// Float player.
void setDefaultFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> delegate);
void replaceFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> replacement);
void restoreFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> replacement);
[[nodiscard]] rpl::producer<FullMsgId> floatPlayerClosed() const;
void logout(Main::Account *account = nullptr);
void forceLogOut(
not_null<Main::Account*> account,
@@ -320,6 +333,10 @@ private:
const std::unique_ptr<Media::Audio::Instance> _audio;
std::unique_ptr<Media::Player::FloatController> _floatPlayers;
Media::Player::FloatDelegate *_defaultFloatPlayerDelegate = nullptr;
Media::Player::FloatDelegate *_replacementFloatPlayerDelegate = nullptr;
// Notifications should be destroyed before _audio.
// Mutable because is created in run() after OpenSSL is inited.
std::unique_ptr<Window::Notifications::System> _notifications;