Hide video preview in PIP mode so we can fully see the remote video
This commit is contained in:
parent
4e375754ed
commit
11a83b71eb
3 changed files with 5 additions and 0 deletions
|
@ -125,5 +125,6 @@ class CallActivity : ProximitySensorActivity() {
|
||||||
if (isInPictureInPictureMode) {
|
if (isInPictureInPictureMode) {
|
||||||
viewModel.areControlsHidden.value = true
|
viewModel.areControlsHidden.value = true
|
||||||
}
|
}
|
||||||
|
viewModel.isVideoPreviewHidden.value = isInPictureInPictureMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@ import org.linphone.utils.Event
|
||||||
class ControlsFadingViewModel : ViewModel() {
|
class ControlsFadingViewModel : ViewModel() {
|
||||||
val areControlsHidden = MutableLiveData<Boolean>()
|
val areControlsHidden = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
|
val isVideoPreviewHidden = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
val videoEnabledEvent = MutableLiveData<Event<Boolean>>()
|
val videoEnabledEvent = MutableLiveData<Event<Boolean>>()
|
||||||
|
|
||||||
private var timer: Timer? = null
|
private var timer: Timer? = null
|
||||||
|
@ -60,6 +62,7 @@ class ControlsFadingViewModel : ViewModel() {
|
||||||
coreContext.core.addListener(listener)
|
coreContext.core.addListener(listener)
|
||||||
|
|
||||||
areControlsHidden.value = false
|
areControlsHidden.value = false
|
||||||
|
isVideoPreviewHidden.value = false
|
||||||
|
|
||||||
val currentCall = coreContext.core.currentCall
|
val currentCall = coreContext.core.currentCall
|
||||||
if (currentCall != null && currentCall.currentParams.videoEnabled()) {
|
if (currentCall != null && currentCall.currentParams.videoEnabled()) {
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
<org.linphone.mediastream.video.capture.CaptureTextureView
|
<org.linphone.mediastream.video.capture.CaptureTextureView
|
||||||
android:onTouch="@{previewTouchListener}"
|
android:onTouch="@{previewTouchListener}"
|
||||||
|
android:visibility="@{viewModel.isVideoPreviewHidden ? View.INVISIBLE : View.VISIBLE}"
|
||||||
android:id="@+id/local_preview_video_surface"
|
android:id="@+id/local_preview_video_surface"
|
||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="200dp"
|
android:layout_height="200dp"
|
||||||
|
|
Loading…
Reference in a new issue