mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-27 08:39:19 +00:00
Fixed auto full screen issue in conference
This commit is contained in:
parent
2be4f691f2
commit
6ad5f7573b
3 changed files with 36 additions and 5 deletions
|
|
@ -226,6 +226,17 @@ class ActiveConferenceCallFragment : GenericCallFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
callViewModel.conferenceModel.firstParticipantOtherThanOurselvesJoinedEvent.observe(
|
||||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume {
|
||||
if (callViewModel.fullScreenMode.value == false) {
|
||||
Log.i("$TAG First participant joined conference, switching to full screen mode")
|
||||
callViewModel.toggleFullScreen()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
callViewModel.goToCallEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
if (findNavController().currentDestination?.id == R.id.activeConferenceCallFragment) {
|
||||
|
|
|
|||
|
|
@ -73,6 +73,10 @@ class ConferenceViewModel @UiThread constructor() : GenericViewModel() {
|
|||
|
||||
val isMeAdmin = MutableLiveData<Boolean>()
|
||||
|
||||
val firstParticipantOtherThanOurselvesJoinedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
||||
val showLayoutMenuEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||
MutableLiveData<Event<Boolean>>()
|
||||
}
|
||||
|
|
@ -90,6 +94,11 @@ class ConferenceViewModel @UiThread constructor() : GenericViewModel() {
|
|||
"$TAG Participant added: ${participant.address.asStringUriOnly()}"
|
||||
)
|
||||
addParticipant(participant)
|
||||
|
||||
if (conference.participantList.size == 1) { // we do not count
|
||||
Log.i("$TAG First participant other than ourselves joined the conference")
|
||||
firstParticipantOtherThanOurselvesJoinedEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
|
|
@ -226,9 +235,13 @@ class ConferenceViewModel @UiThread constructor() : GenericViewModel() {
|
|||
if (conference.state == Conference.State.Created) {
|
||||
val isIn = conference.isIn
|
||||
isPaused.postValue(!isIn)
|
||||
Log.i("$TAG We ${if (isIn) "are" else "aren't"} in the conference")
|
||||
Log.i("$TAG We [${if (isIn) "are" else "aren't"}] in the conference")
|
||||
|
||||
computeParticipants(false)
|
||||
if (conference.participantList.size >= 1) { // we do not count
|
||||
Log.i("$TAG Joined conference already has at least another participant")
|
||||
firstParticipantOtherThanOurselvesJoinedEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -278,6 +291,10 @@ class ConferenceViewModel @UiThread constructor() : GenericViewModel() {
|
|||
|
||||
if (conference.state == Conference.State.Created) {
|
||||
computeParticipants(false)
|
||||
if (conference.participantList.size >= 1) { // we do not count
|
||||
Log.i("$TAG Joined conference already has at least another participant")
|
||||
firstParticipantOtherThanOurselvesJoinedEvent.postValue(Event(true))
|
||||
}
|
||||
}
|
||||
|
||||
val currentLayout = getCurrentLayout(call)
|
||||
|
|
|
|||
|
|
@ -1198,10 +1198,13 @@ class CurrentCallViewModel @UiThread constructor() : GenericViewModel() {
|
|||
|
||||
if (((isReceiving) && !wasReceiving)) {
|
||||
if (fullScreenMode.value != true) {
|
||||
Log.i(
|
||||
"$TAG Video is being received (it wasn't before), switching to full-screen mode"
|
||||
)
|
||||
fullScreenMode.postValue(true)
|
||||
val inConference = conferenceModel.isCurrentCallInConference.value == true
|
||||
if (!inConference) {
|
||||
Log.i(
|
||||
"$TAG Video is being received (it wasn't before), switching to full-screen mode"
|
||||
)
|
||||
fullScreenMode.postValue(true)
|
||||
}
|
||||
}
|
||||
} else if (!isSending && !isReceiving && fullScreenMode.value == true) {
|
||||
Log.w("$TAG Video is no longer enabled, leaving full screen mode")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue