mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Check if outgoing early-media call is really doing video instead of assuming it is
This commit is contained in:
parent
0c17aea1c7
commit
4d4bbafdb0
1 changed files with 9 additions and 2 deletions
|
|
@ -28,9 +28,11 @@ import androidx.core.view.doOnLayout
|
|||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.core.Call
|
||||
import org.linphone.core.tools.Log
|
||||
import org.linphone.databinding.CallOutgoingFragmentBinding
|
||||
import org.linphone.ui.call.viewmodel.CurrentCallViewModel
|
||||
import org.linphone.utils.LinphoneUtils
|
||||
|
||||
@UiThread
|
||||
class OutgoingCallFragment : GenericCallFragment() {
|
||||
|
|
@ -66,8 +68,13 @@ class OutgoingCallFragment : GenericCallFragment() {
|
|||
callViewModel.isOutgoingEarlyMedia.observe(viewLifecycleOwner) { earlyMedia ->
|
||||
if (earlyMedia) {
|
||||
coreContext.postOnCoreThread { core ->
|
||||
Log.i("$TAG Outgoing early-media call with video, setting preview surface")
|
||||
core.nativePreviewWindowId = binding.localPreviewVideoSurface
|
||||
val call = core.calls.find {
|
||||
it.state == Call.State.OutgoingEarlyMedia
|
||||
}
|
||||
if (call != null && LinphoneUtils.isVideoEnabled(call)) {
|
||||
Log.i("$TAG Outgoing early-media call with video, setting preview surface")
|
||||
core.nativePreviewWindowId = binding.localPreviewVideoSurface
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue