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
if participantDevice.address != nil {
}, onActiveSpeakerParticipantDevice: { (conference: Conference, participantDevice: ParticipantDevice?) in
if participantDevice != nil && participantDevice!.address != nil {
let activeSpeakerParticipantBis = self.activeSpeakerParticipant
let activeSpeakerParticipantTmp = ParticipantModel(
address: participantDevice.address!,
address: participantDevice!.address!,
isJoining: false,
onPause: participantDevice.state == .OnHold,
isMuted: participantDevice.isMuted
onPause: participantDevice!.state == .OnHold,
isMuted: participantDevice!.isMuted
)
var activeSpeakerNameTmp = ""