2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Active round video moving to active window.

This commit is contained in:
John Preston
2023-01-19 11:40:39 +04:00
parent b80b770631
commit ec3957fcf3
14 changed files with 140 additions and 78 deletions

View File

@@ -480,6 +480,40 @@ auto Controller::openInMediaViewRequests() const
return _openInMediaViewRequests.events();
}
void Controller::setDefaultFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> delegate) {
_defaultFloatPlayerDelegate = delegate;
_replacementFloatPlayerDelegate = nullptr;
_floatPlayerDelegate = delegate;
}
void Controller::replaceFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> replacement) {
Expects(_defaultFloatPlayerDelegate != nullptr);
_replacementFloatPlayerDelegate = replacement;
_floatPlayerDelegate = replacement;
}
void Controller::restoreFloatPlayerDelegate(
not_null<Media::Player::FloatDelegate*> replacement) {
Expects(_defaultFloatPlayerDelegate != nullptr);
if (_replacementFloatPlayerDelegate == replacement) {
_replacementFloatPlayerDelegate = nullptr;
_floatPlayerDelegate = _defaultFloatPlayerDelegate;
}
}
auto Controller::floatPlayerDelegate() const -> FloatDelegate* {
return _floatPlayerDelegate.current();
}
auto Controller::floatPlayerDelegateValue() const
-> rpl::producer<FloatDelegate*> {
return _floatPlayerDelegate.value();
}
rpl::lifetime &Controller::lifetime() {
return _lifetime;
}