From d17316f7b26c101080fc3f70ee82b401b3f87298 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 17 Jun 2021 15:43:49 +0300 Subject: [PATCH] fix disconected stream --- .../kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index 5b98b27d..d89c939c 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -371,6 +371,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session Log.d(TAG, "onDisconnected: disconnected from session " + session.sessionId) mSession = null cmTimer.stop() + disconnectSession() } override fun onError(session: Session, opentokError: OpentokError) { @@ -477,11 +478,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mSession!!.subscribe(mSubscriber) } - override fun dismiss() { - videoCallResponseListener?.onCallFinished(1000) - super.dismiss() - } - private fun disconnectSession() { if (mSession == null) { videoCallResponseListener?.onCallFinished(Activity.RESULT_CANCELED) @@ -489,6 +485,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session dialog?.dismiss() return } + if (mSubscriber != null) { mSubscriberViewContainer.removeView(mSubscriber!!.view) mSession!!.unsubscribe(mSubscriber) @@ -503,6 +500,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } mSession!!.disconnect() countDownTimer?.cancel() + videoCallPresenter.callChangeCallStatus(ChangeCallStatusRequestModel(16, sessionStatusModel!!.doctorId, sessionStatusModel!!.generalid, token, sessionStatusModel!!.vcid)) dialog?.dismiss() }