mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Conference listener onActiveSpeakerParticipantDevice signature has changed
This commit is contained in:
parent
5e6186d115
commit
0625239477
1 changed files with 26 additions and 12 deletions
|
|
@ -134,22 +134,36 @@ class ConferenceViewModel
|
|||
@WorkerThread
|
||||
override fun onActiveSpeakerParticipantDevice(
|
||||
conference: Conference,
|
||||
participantDevice: ParticipantDevice
|
||||
participantDevice: ParticipantDevice?
|
||||
) {
|
||||
activeSpeaker.value?.isActiveSpeaker?.postValue(false)
|
||||
|
||||
val found = participantDevices.value.orEmpty().find {
|
||||
it.device.address.equal(participantDevice.address)
|
||||
}
|
||||
if (found != null) {
|
||||
Log.i("$TAG Newly active speaker participant is [${found.name}]")
|
||||
found.isActiveSpeaker.postValue(true)
|
||||
activeSpeaker.postValue(found!!)
|
||||
if (participantDevice != null) {
|
||||
val found = participantDevices.value.orEmpty().find {
|
||||
it.device.address.equal(participantDevice.address)
|
||||
}
|
||||
if (found != null) {
|
||||
Log.i("$TAG Newly active speaker participant is [${found.name}]")
|
||||
found.isActiveSpeaker.postValue(true)
|
||||
activeSpeaker.postValue(found!!)
|
||||
} else {
|
||||
Log.i("$TAG Failed to find actively speaking participant...")
|
||||
val model = ConferenceParticipantDeviceModel(participantDevice)
|
||||
model.isActiveSpeaker.postValue(true)
|
||||
activeSpeaker.postValue(model)
|
||||
}
|
||||
} else {
|
||||
Log.i("$TAG Failed to find actively speaking participant...")
|
||||
val model = ConferenceParticipantDeviceModel(participantDevice)
|
||||
model.isActiveSpeaker.postValue(true)
|
||||
activeSpeaker.postValue(model)
|
||||
Log.w("$TAG Notified active speaker participant device is null, using first one that's not us")
|
||||
val firstNotUs = participantDevices.value.orEmpty().find {
|
||||
it.isMe == false
|
||||
}
|
||||
if (firstNotUs != null) {
|
||||
Log.i("$TAG Newly active speaker participant is [${firstNotUs.name}]")
|
||||
firstNotUs.isActiveSpeaker.postValue(true)
|
||||
activeSpeaker.postValue(firstNotUs!!)
|
||||
} else {
|
||||
Log.i("$TAG No participant device that's not us found, expected if we're alone")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue