Deprioritize speaker video when there is a screenshare presenting
This commit is contained in:
parent
00f622dfc3
commit
4dd96105cb
@ -63,6 +63,7 @@ class GroupCallRemoteVideoManager {
|
||||
guard let groupCall = self.currentRingRtcCall else { return }
|
||||
|
||||
var activeSpeakerHeight: UInt16 = 0
|
||||
var isSomeonePresenting = false
|
||||
|
||||
let videoRequests: [VideoRequest] = groupCall.remoteDeviceStates.map { demuxId, _ in
|
||||
guard
|
||||
@ -72,6 +73,8 @@ class GroupCallRemoteVideoManager {
|
||||
return VideoRequest(demuxId: demuxId, width: 0, height: 0, framerate: nil)
|
||||
}
|
||||
|
||||
isSomeonePresenting = isSomeonePresenting || renderingVideoViews.contains(where: \.value.isScreenShare)
|
||||
|
||||
if let activeSpeakerVideoView = renderingVideoViews[.speaker] {
|
||||
activeSpeakerHeight = max(activeSpeakerHeight, UInt16(activeSpeakerVideoView.currentSize.height))
|
||||
}
|
||||
@ -88,6 +91,9 @@ class GroupCallRemoteVideoManager {
|
||||
)
|
||||
}
|
||||
|
||||
// currently we do not support presenting + speaker videos
|
||||
// so when someone is presenting, do not prioritize active speaker video over presenter video
|
||||
activeSpeakerHeight = isSomeonePresenting ? 0 : activeSpeakerHeight
|
||||
groupCall.updateVideoRequests(resolutions: videoRequests, activeSpeakerHeight: activeSpeakerHeight)
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user