mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-20 09:58:28 +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
|
@WorkerThread
|
||||||
override fun onActiveSpeakerParticipantDevice(
|
override fun onActiveSpeakerParticipantDevice(
|
||||||
conference: Conference,
|
conference: Conference,
|
||||||
participantDevice: ParticipantDevice
|
participantDevice: ParticipantDevice?
|
||||||
) {
|
) {
|
||||||
activeSpeaker.value?.isActiveSpeaker?.postValue(false)
|
activeSpeaker.value?.isActiveSpeaker?.postValue(false)
|
||||||
|
|
||||||
val found = participantDevices.value.orEmpty().find {
|
if (participantDevice != null) {
|
||||||
it.device.address.equal(participantDevice.address)
|
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}]")
|
if (found != null) {
|
||||||
found.isActiveSpeaker.postValue(true)
|
Log.i("$TAG Newly active speaker participant is [${found.name}]")
|
||||||
activeSpeaker.postValue(found!!)
|
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 {
|
} else {
|
||||||
Log.i("$TAG Failed to find actively speaking participant...")
|
Log.w("$TAG Notified active speaker participant device is null, using first one that's not us")
|
||||||
val model = ConferenceParticipantDeviceModel(participantDevice)
|
val firstNotUs = participantDevices.value.orEmpty().find {
|
||||||
model.isActiveSpeaker.postValue(true)
|
it.isMe == false
|
||||||
activeSpeaker.postValue(model)
|
}
|
||||||
|
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