Allow participantDevice to be nullable in onActiveSpeakerParticipantDevice callback

This commit is contained in:
Benoit Martins 2025-01-31 14:11:31 +01:00
parent a3c20e3ae7
commit cf109f9787

View file

@ -580,15 +580,15 @@ class CallViewModel: ObservableObject {
} }
} }
}) })
}, onActiveSpeakerParticipantDevice: { (conference: Conference, participantDevice: ParticipantDevice) in }, onActiveSpeakerParticipantDevice: { (conference: Conference, participantDevice: ParticipantDevice?) in
if participantDevice.address != nil { if participantDevice != nil && participantDevice!.address != nil {
let activeSpeakerParticipantBis = self.activeSpeakerParticipant let activeSpeakerParticipantBis = self.activeSpeakerParticipant
let activeSpeakerParticipantTmp = ParticipantModel( let activeSpeakerParticipantTmp = ParticipantModel(
address: participantDevice.address!, address: participantDevice!.address!,
isJoining: false, isJoining: false,
onPause: participantDevice.state == .OnHold, onPause: participantDevice!.state == .OnHold,
isMuted: participantDevice.isMuted isMuted: participantDevice!.isMuted
) )
var activeSpeakerNameTmp = "" var activeSpeakerNameTmp = ""