Fix when participant device is nil

This commit is contained in:
Benoit Martins 2024-04-30 11:48:16 +02:00
parent f6e935c65f
commit 46c41c1218

View file

@ -386,12 +386,12 @@ class TelecomManager: ObservableObject {
if call.conference!.activeSpeakerParticipantDevice != nil {
let direction = call.conference?.activeSpeakerParticipantDevice!.getStreamCapability(streamType: StreamType.Video)
self.remoteConfVideo = direction == .SendRecv || direction == .SendOnly
} else if call.conference!.participantList.first != nil
} else if call.conference!.participantList.first != nil && call.conference!.participantDeviceList.first != nil
&& call.conference!.participantList.first?.address != nil
&& call.conference!.participantList.first!.address!.clone()!.equal(address2: (call.conference!.me?.address)!) {
let direction = call.conference!.participantDeviceList.first!.getStreamCapability(streamType: StreamType.Video)
self.remoteConfVideo = direction == .SendRecv || direction == .SendOnly
} else if call.conference!.participantList.last != nil
} else if call.conference!.participantList.last != nil && call.conference!.participantDeviceList.last != nil
&& call.conference!.participantList.last?.address != nil {
let direction = call.conference!.participantDeviceList.last!.getStreamCapability(streamType: StreamType.Video)
self.remoteConfVideo = direction == .SendRecv || direction == .SendOnly