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

Support three-value VideoState.

This commit is contained in:
John Preston
2020-08-05 16:11:18 +04:00
parent a89634b767
commit 95de762529
5 changed files with 92 additions and 55 deletions

View File

@@ -361,8 +361,10 @@ void Panel::initControls() {
});
_camera->setClickedCallback([=] {
if (_call) {
_call->videoOutgoing()->setEnabled(
!_call->videoOutgoing()->enabled());
_call->videoOutgoing()->setState(
(_call->videoOutgoing()->state() == webrtc::VideoState::Active)
? webrtc::VideoState::Inactive
: webrtc::VideoState::Active);
}
});
@@ -430,9 +432,11 @@ void Panel::reinitWithCall(Call *call) {
_mute->setIconOverride(mute ? &st::callUnmuteIcon : nullptr);
}, _callLifetime);
_call->videoOutgoing()->enabledValue(
) | rpl::start_with_next([=](bool enabled) {
_camera->setIconOverride(enabled ? nullptr : &st::callNoCameraIcon);
_call->videoOutgoing()->stateValue(
) | rpl::start_with_next([=](webrtc::VideoState state) {
_camera->setIconOverride((state == webrtc::VideoState::Active)
? nullptr
: &st::callNoCameraIcon);
}, _callLifetime);
_call->stateValue(