[Videochats] Request thumbnail videos when a video is on stage

This commit is contained in:
Isaac 2024-08-27 23:04:58 +08:00
parent f21f7f66f7
commit 1567e6719c

View File

@ -819,13 +819,21 @@ final class VideoChatParticipantsComponent: Component {
if let members = component.members { if let members = component.members {
for participant in members.participants { for participant in members.participants {
var maxVideoQuality: PresentationGroupCallRequestedVideo.Quality = .medium var maxVideoQuality: PresentationGroupCallRequestedVideo.Quality = .medium
if let expandedVideoState = component.expandedVideoState, expandedVideoState.mainParticipant.id == participant.peer.id, !expandedVideoState.mainParticipant.isPresentation { if let expandedVideoState = component.expandedVideoState {
maxVideoQuality = .full if expandedVideoState.mainParticipant.id == participant.peer.id, !expandedVideoState.mainParticipant.isPresentation {
maxVideoQuality = .full
} else {
maxVideoQuality = .thumbnail
}
} }
var maxPresentationQuality: PresentationGroupCallRequestedVideo.Quality = .medium var maxPresentationQuality: PresentationGroupCallRequestedVideo.Quality = .medium
if let expandedVideoState = component.expandedVideoState, expandedVideoState.mainParticipant.id == participant.peer.id, expandedVideoState.mainParticipant.isPresentation { if let expandedVideoState = component.expandedVideoState {
maxPresentationQuality = .full if expandedVideoState.mainParticipant.id == participant.peer.id, expandedVideoState.mainParticipant.isPresentation {
maxPresentationQuality = .full
} else {
maxPresentationQuality = .thumbnail
}
} }
if let videoChannel = participant.requestedVideoChannel(minQuality: .thumbnail, maxQuality: maxVideoQuality) { if let videoChannel = participant.requestedVideoChannel(minQuality: .thumbnail, maxQuality: maxVideoQuality) {