Rejoin if the call started accepting video.

This commit is contained in:
John Preston 2021-05-31 18:00:41 +04:00
parent 464b0a0f30
commit b3c92ed3f4

View file

@ -555,6 +555,20 @@ void GroupCall::subscribeToReal(not_null<Data::GroupCall*> real) {
setScheduledDate(date); setScheduledDate(date);
}, _lifetime); }, _lifetime);
// If we joined before you could start video and then you can,
// you have to rejoin so that the server knows your video params.
real->canStartVideoValue(
) | rpl::combine_previous(
) | rpl::start_with_next([=](bool could, bool can) {
if (could || !can) {
return;
} if (_joinState.action == JoinAction::None) {
rejoin();
} else {
_joinState.nextActionPending = true;
}
}, _lifetime);
// Postpone creating video tracks, so that we know if Panel // Postpone creating video tracks, so that we know if Panel
// supports OpenGL and we don't need ARGB32 frames at all. // supports OpenGL and we don't need ARGB32 frames at all.
Ui::PostponeCall(this, [=] { Ui::PostponeCall(this, [=] {