Auto-pin new screencasts.

This commit is contained in:
John Preston 2021-05-31 15:53:15 +04:00
parent d19d6bbcd9
commit bcdfd2150d

View file

@ -951,10 +951,15 @@ void GroupCall::markEndpointActive(VideoEndpoint endpoint, bool active) {
}
void GroupCall::markTrackShown(const VideoEndpoint &endpoint, bool shown) {
if ((shown && _shownVideoTracks.emplace(endpoint).second)
|| (!shown && _shownVideoTracks.remove(endpoint))) {
const auto changed = shown
? _shownVideoTracks.emplace(endpoint).second
: _shownVideoTracks.remove(endpoint);
if (changed) {
_videoStreamShownUpdates.fire_copy({ endpoint, shown });
}
if (shown && changed && endpoint.type == VideoEndpointType::Screen) {
pinVideoEndpoint(endpoint);
}
}
void GroupCall::rejoin() {