Fix video members notices

This commit is contained in:
Ilya Laktyushin
2021-07-29 00:42:59 +03:00
parent e718f986e1
commit 1907a30d50
4 changed files with 43 additions and 24 deletions

View File

@@ -168,6 +168,26 @@ public protocol PresentationCall: class {
func makeOutgoingVideoView(completion: @escaping (PresentationCallVideoView?) -> Void)
}
public struct VoiceChatConfiguration {
public static var defaultValue: VoiceChatConfiguration {
return VoiceChatConfiguration(videoParticipantsMaxCount: 30)
}
public let videoParticipantsMaxCount: Int32
fileprivate init(videoParticipantsMaxCount: Int32) {
self.videoParticipantsMaxCount = videoParticipantsMaxCount
}
public static func with(appConfiguration: AppConfiguration) -> VoiceChatConfiguration {
if let data = appConfiguration.data, let value = data["groupcall_video_participants_max"] as? Double {
return VoiceChatConfiguration(videoParticipantsMaxCount: Int32(value))
} else {
return .defaultValue
}
}
}
public struct PresentationGroupCallState: Equatable {
public enum NetworkState {
case connecting
@@ -191,6 +211,7 @@ public struct PresentationGroupCallState: Equatable {
public var scheduleTimestamp: Int32?
public var subscribedToScheduled: Bool
public var isVideoEnabled: Bool
public var isVideoWatchersLimitReached: Bool
public init(
myPeerId: PeerId,
@@ -204,7 +225,8 @@ public struct PresentationGroupCallState: Equatable {
raisedHand: Bool,
scheduleTimestamp: Int32?,
subscribedToScheduled: Bool,
isVideoEnabled: Bool
isVideoEnabled: Bool,
isVideoWatchersLimitReached: Bool
) {
self.myPeerId = myPeerId
self.networkState = networkState
@@ -218,6 +240,7 @@ public struct PresentationGroupCallState: Equatable {
self.scheduleTimestamp = scheduleTimestamp
self.subscribedToScheduled = subscribedToScheduled
self.isVideoEnabled = isVideoEnabled
self.isVideoWatchersLimitReached = isVideoWatchersLimitReached
}
}