diff --git a/app/src/main/java/org/linphone/activities/voip/data/ConferenceParticipantDeviceData.kt b/app/src/main/java/org/linphone/activities/voip/data/ConferenceParticipantDeviceData.kt index 2fb7fda14..4091c4f8e 100644 --- a/app/src/main/java/org/linphone/activities/voip/data/ConferenceParticipantDeviceData.kt +++ b/app/src/main/java/org/linphone/activities/voip/data/ConferenceParticipantDeviceData.kt @@ -19,7 +19,6 @@ */ package org.linphone.activities.voip.data -import android.graphics.SurfaceTexture import android.view.TextureView import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.MutableLiveData @@ -155,45 +154,12 @@ class ConferenceParticipantDeviceData( fun setTextureView(tv: TextureView) { textureView = tv - if (tv.isAvailable) { - Log.i("[Conference Participant Device] Setting textureView [$textureView] for participant [${participantDevice.address.asStringUriOnly()}]") - updateWindowId(textureView) - } else { - Log.i("[Conference Participant Device] Got textureView [$textureView] for participant [${participantDevice.address.asStringUriOnly()}], but it is not available yet") - tv.surfaceTextureListener = object : TextureView.SurfaceTextureListener { - override fun onSurfaceTextureAvailable( - surface: SurfaceTexture, - width: Int, - height: Int - ) { - Log.i("[Conference Participant Device] Setting textureView [$textureView] for participant [${participantDevice.address.asStringUriOnly()}]") - updateWindowId(textureView) - } - - override fun onSurfaceTextureSizeChanged( - surface: SurfaceTexture, - width: Int, - height: Int - ) { } - - override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean { - Log.w("[Conference Participant Device] TextureView [$textureView] for participant [${participantDevice.address.asStringUriOnly()}] has been destroyed") - textureView = null - updateWindowId(null) - return true - } - - override fun onSurfaceTextureUpdated(surface: SurfaceTexture) { } - } - } + Log.i("[Conference Participant Device] Setting textureView [$textureView] for participant [${participantDevice.address.asStringUriOnly()}]") + updateWindowId(textureView) } private fun updateWindowId(windowId: Any?) { - if (isMe) { - coreContext.core.nativePreviewWindowId = windowId - } else { - participantDevice.nativeVideoWindowId = windowId - } + participantDevice.nativeVideoWindowId = windowId } private fun isVideoAvailableAndSendReceive(): Boolean {