|
|
|
|
@ -11,10 +11,12 @@ import android.graphics.Point
|
|
|
|
|
import android.graphics.drawable.ColorDrawable
|
|
|
|
|
import android.opengl.GLSurfaceView
|
|
|
|
|
import android.os.*
|
|
|
|
|
import android.util.DisplayMetrics
|
|
|
|
|
import android.util.Log
|
|
|
|
|
import android.view.*
|
|
|
|
|
import android.widget.*
|
|
|
|
|
import androidx.annotation.Nullable
|
|
|
|
|
import androidx.appcompat.app.AlertDialog
|
|
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout
|
|
|
|
|
import androidx.core.content.ContextCompat
|
|
|
|
|
import androidx.core.view.GestureDetectorCompat
|
|
|
|
|
@ -28,7 +30,7 @@ import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView
|
|
|
|
|
import com.hmg.hmgDr.ui.VideoCallPresenterImpl
|
|
|
|
|
import com.hmg.hmgDr.ui.VideoCallResponseListener
|
|
|
|
|
import com.hmg.hmgDr.util.DynamicVideoRenderer
|
|
|
|
|
import com.hmg.hmgDr.util.ThumbnailCircleVideoRenderer
|
|
|
|
|
import com.hmg.hmgDr.util.ViewsUtil
|
|
|
|
|
import com.opentok.android.*
|
|
|
|
|
import com.opentok.android.PublisherKit.PublisherListener
|
|
|
|
|
import pub.devrel.easypermissions.AfterPermissionGranted
|
|
|
|
|
@ -37,7 +39,8 @@ import pub.devrel.easypermissions.EasyPermissions
|
|
|
|
|
import pub.devrel.easypermissions.EasyPermissions.PermissionCallbacks
|
|
|
|
|
import kotlin.math.ceil
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check this if it works to solve keyboard not work when dialog is opened
|
|
|
|
|
// https://stackoverflow.com/questions/55066977/how-to-prevent-custom-dialogfragment-from-hiding-keyboard-when-being-shown
|
|
|
|
|
class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.SessionListener,
|
|
|
|
|
PublisherListener,
|
|
|
|
|
SubscriberKit.VideoListener, VideoCallView {
|
|
|
|
|
@ -65,6 +68,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
|
|
|
|
|
private lateinit var recordContainer: FrameLayout
|
|
|
|
|
private lateinit var thumbnail_container: FrameLayout
|
|
|
|
|
private lateinit var activity_clingo_video_call: RelativeLayout
|
|
|
|
|
private lateinit var mPublisherViewContainer: FrameLayout
|
|
|
|
|
private lateinit var mPublisherViewIcon: View
|
|
|
|
|
private lateinit var mSubscriberViewContainer: FrameLayout
|
|
|
|
|
@ -119,20 +123,47 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
override fun onStart() {
|
|
|
|
|
super.onStart()
|
|
|
|
|
|
|
|
|
|
// val params: ViewGroup.LayoutParams = dialog!!.window!!.attributes
|
|
|
|
|
// params.width = WindowManager.LayoutParams.MATCH_PARENT
|
|
|
|
|
// params.height = WindowManager.LayoutParams.MATCH_PARENT
|
|
|
|
|
// dialog!!.window!!.attributes = params as WindowManager.LayoutParams
|
|
|
|
|
|
|
|
|
|
dialog?.window?.setLayout(
|
|
|
|
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
|
|
|
|
LinearLayout.LayoutParams.MATCH_PARENT
|
|
|
|
|
)
|
|
|
|
|
// val parentLayoutParam: FrameLayout.LayoutParams = /*parentView.layoutParams as*/ FrameLayout.LayoutParams(
|
|
|
|
|
// LinearLayout.LayoutParams.MATCH_PARENT,
|
|
|
|
|
// LinearLayout.LayoutParams.MATCH_PARENT
|
|
|
|
|
// )
|
|
|
|
|
// parentView.layoutParams = parentLayoutParam
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun getTheme(): Int {
|
|
|
|
|
return R.style.dialogTheme
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {
|
|
|
|
|
val dialog: Dialog = super.onCreateDialog(savedInstanceState)
|
|
|
|
|
override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme
|
|
|
|
|
val layoutInflater = activity!!.layoutInflater
|
|
|
|
|
this.parentView = onCreateView(layoutInflater, null)
|
|
|
|
|
|
|
|
|
|
// Add back button listener
|
|
|
|
|
val alertDialogBuilder: AlertDialog.Builder =
|
|
|
|
|
AlertDialog.Builder(requireContext(), R.style.dialogTheme)
|
|
|
|
|
// .setTitle(android.R.string.select_a_color)
|
|
|
|
|
.setView(this.parentView)
|
|
|
|
|
// .setPositiveButton(android.R.string.ok, { dialogInterface, i -> })
|
|
|
|
|
alertDialogBuilder.setOnKeyListener { _, keyCode, keyEvent ->
|
|
|
|
|
// getAction to make sure this doesn't double fire
|
|
|
|
|
if (keyCode == KeyEvent.KEYCODE_BACK && keyEvent.action == KeyEvent.ACTION_UP) {
|
|
|
|
|
videoCallResponseListener?.onBackHandle()
|
|
|
|
|
false // Capture onKey
|
|
|
|
|
} else true
|
|
|
|
|
// Don't capture
|
|
|
|
|
}
|
|
|
|
|
return alertDialogBuilder.create()
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
val dialog: Dialog = super.onCreateDialog(savedInstanceState)
|
|
|
|
|
// Add back button listener
|
|
|
|
|
dialog.setOnKeyListener { _, keyCode, keyEvent ->
|
|
|
|
|
// getAction to make sure this doesn't double fire
|
|
|
|
|
@ -144,6 +175,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return dialog
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
|
|
|
@ -171,13 +203,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
this.videoCallResponseListener = videoCallResponseListener
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onCreateView(
|
|
|
|
|
inflater: LayoutInflater, container: ViewGroup?,
|
|
|
|
|
savedInstanceState: Bundle?
|
|
|
|
|
private fun onCreateView(
|
|
|
|
|
inflater: LayoutInflater, container: ViewGroup?
|
|
|
|
|
): View {
|
|
|
|
|
val view = inflater.inflate(R.layout.activity_video_call, container, false)
|
|
|
|
|
|
|
|
|
|
parentView = inflater.inflate(R.layout.activity_video_call, container, false)
|
|
|
|
|
|
|
|
|
|
// val parentViewLayoutParam: ConstraintLayout.LayoutParams = ConstraintLayout.LayoutParams(
|
|
|
|
|
// ConstraintLayout.LayoutParams.MATCH_PARENT,
|
|
|
|
|
// ConstraintLayout.LayoutParams.MATCH_PARENT
|
|
|
|
|
// )
|
|
|
|
|
// parentView.layoutParams = parentViewLayoutParam
|
|
|
|
|
// Objects.requireNonNull(requireActivity().actionBar)!!.hide()
|
|
|
|
|
arguments?.run {
|
|
|
|
|
apiKey = getString("apiKey")
|
|
|
|
|
@ -189,7 +224,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
if (sessionStatusModel != null)
|
|
|
|
|
isRecording = sessionStatusModel!!.isRecording
|
|
|
|
|
}
|
|
|
|
|
initUI(parentView)
|
|
|
|
|
initUI(view)
|
|
|
|
|
requestPermissions()
|
|
|
|
|
|
|
|
|
|
handleDragDialog()
|
|
|
|
|
@ -198,9 +233,15 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() })
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return parentView
|
|
|
|
|
return view
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onCreateView(
|
|
|
|
|
inflater: LayoutInflater, container: ViewGroup?,
|
|
|
|
|
savedInstanceState: Bundle?
|
|
|
|
|
): View {
|
|
|
|
|
return this.parentView
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onPause() {
|
|
|
|
|
super.onPause()
|
|
|
|
|
@ -230,10 +271,13 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
|
|
private fun initUI(view: View) {
|
|
|
|
|
videoCallContainer = view.findViewById(R.id.video_call_ll)
|
|
|
|
|
|
|
|
|
|
layoutName = view.findViewById(R.id.layout_name)
|
|
|
|
|
layoutMini = view.findViewById(R.id.layout_mini)
|
|
|
|
|
icMini = view.findViewById(R.id.ic_mini)
|
|
|
|
|
recordContainer = view.findViewById(R.id.record_container)
|
|
|
|
|
activity_clingo_video_call = view.findViewById(R.id.activity_clingo_video_call)
|
|
|
|
|
|
|
|
|
|
thumbnail_container = view.findViewById(R.id.thumbnail_container)
|
|
|
|
|
mPublisherViewContainer = view.findViewById(R.id.local_video_view_container)
|
|
|
|
|
mPublisherViewIcon = view.findViewById(R.id.local_video_view_icon)
|
|
|
|
|
@ -249,10 +293,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
recordContainer.visibility = View.GONE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cmTimer = view.findViewById<Chronometer>(R.id.cmTimer)
|
|
|
|
|
cmTimer = view.findViewById(R.id.cmTimer)
|
|
|
|
|
cmTimer.format = "mm:ss"
|
|
|
|
|
cmTimer.onChronometerTickListener =
|
|
|
|
|
Chronometer.OnChronometerTickListener { arg0: Chronometer? ->
|
|
|
|
|
// val f: NumberFormat = DecimalFormat("00")
|
|
|
|
|
// f.format(minutes)
|
|
|
|
|
val minutes: Long
|
|
|
|
|
val seconds: Long
|
|
|
|
|
if (!resume) {
|
|
|
|
|
@ -264,8 +310,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
seconds = (elapsedTime - cmTimer.base) / 1000 % 60
|
|
|
|
|
elapsedTime += 1000
|
|
|
|
|
}
|
|
|
|
|
arg0?.text = "$minutes:$seconds"
|
|
|
|
|
Log.d(VideoCallFragment.TAG, "onChronometerTick: $minutes : $seconds")
|
|
|
|
|
val format = "%1$02d:%2$02d" // two digits
|
|
|
|
|
|
|
|
|
|
arg0?.text = String.format(format, minutes, seconds)
|
|
|
|
|
Log.d(TAG, "onChronometerTick: $minutes : $seconds")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
icMini.setOnClickListener {
|
|
|
|
|
@ -302,10 +350,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
// progressBar=findViewById(R.id.progress_bar);
|
|
|
|
|
// progressBarTextView=findViewById(R.id.progress_bar_text);
|
|
|
|
|
// progressBar.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// hiddenButtons()
|
|
|
|
|
checkClientConnected()
|
|
|
|
|
handleVideoViewHeight(true)
|
|
|
|
|
|
|
|
|
|
if (appLang == "ar") {
|
|
|
|
|
progressBarLayout!!.layoutDirection = View.LAYOUT_DIRECTION_RTL
|
|
|
|
|
@ -517,9 +564,25 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
}, 4000)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onVideoDisabled(subscriberKit: SubscriberKit?, s: String?) {}
|
|
|
|
|
override fun onVideoDisabled(subscriberKit: SubscriberKit?, s: String?) {
|
|
|
|
|
Log.d(VideoCallFragment.TAG, "onVideoDisabled: Error ($s)")
|
|
|
|
|
|
|
|
|
|
// if (isCircle) {
|
|
|
|
|
// videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
|
|
|
|
|
// mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
|
|
|
|
|
// } else {
|
|
|
|
|
// videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color))
|
|
|
|
|
// mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground))
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onVideoEnabled(subscriberKit: SubscriberKit?, s: String?) {}
|
|
|
|
|
override fun onVideoEnabled(subscriberKit: SubscriberKit?, s: String?) {
|
|
|
|
|
Log.d(VideoCallFragment.TAG, "onVideoEnabled: Error ($s)")
|
|
|
|
|
|
|
|
|
|
// if (mSubscriber != null) {
|
|
|
|
|
// (mSubscriber!!.renderer as DynamicVideoRenderer).enableThumbnailCircle(isCircle)
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onVideoDisableWarning(subscriberKit: SubscriberKit?) {}
|
|
|
|
|
|
|
|
|
|
@ -607,13 +670,12 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
400,
|
|
|
|
|
600
|
|
|
|
|
)
|
|
|
|
|
recordContainer.visibility = View.VISIBLE
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
dialog?.window?.setLayout(
|
|
|
|
|
300,
|
|
|
|
|
300
|
|
|
|
|
)
|
|
|
|
|
recordContainer.visibility = View.GONE
|
|
|
|
|
}
|
|
|
|
|
isCircle = !isCircle
|
|
|
|
|
|
|
|
|
|
@ -640,7 +702,6 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isCircle) {
|
|
|
|
|
@ -650,6 +711,8 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
controlPanel.visibility = View.VISIBLE
|
|
|
|
|
layoutMini.visibility = View.VISIBLE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleVideoViewHeight(isFullScreen)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun onMinimizedClicked(view: View?) {
|
|
|
|
|
@ -658,11 +721,17 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
400,
|
|
|
|
|
600
|
|
|
|
|
)
|
|
|
|
|
recordContainer.visibility = View.GONE
|
|
|
|
|
} else {
|
|
|
|
|
dialog?.window?.setLayout(
|
|
|
|
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
|
|
|
|
LinearLayout.LayoutParams.MATCH_PARENT
|
|
|
|
|
)
|
|
|
|
|
if (isRecording) {
|
|
|
|
|
recordContainer.visibility = View.VISIBLE
|
|
|
|
|
} else {
|
|
|
|
|
recordContainer.visibility = View.GONE
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
isFullScreen = !isFullScreen
|
|
|
|
|
|
|
|
|
|
@ -674,14 +743,15 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun setViewsVisibility() {
|
|
|
|
|
val iconSize: Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt()
|
|
|
|
|
val iconSizeSmall: Int =
|
|
|
|
|
context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt()
|
|
|
|
|
val btnMinimizeLayoutParam: ConstraintLayout.LayoutParams =
|
|
|
|
|
btnMinimize.layoutParams as ConstraintLayout.LayoutParams
|
|
|
|
|
val mCallBtnLayoutParam: ConstraintLayout.LayoutParams =
|
|
|
|
|
mCallBtn.layoutParams as ConstraintLayout.LayoutParams
|
|
|
|
|
|
|
|
|
|
val iconSize: Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt()
|
|
|
|
|
val iconSizeSmall: Int =
|
|
|
|
|
context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt()
|
|
|
|
|
|
|
|
|
|
val localPreviewMargin: Int =
|
|
|
|
|
context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt()
|
|
|
|
|
val localPreviewWidth: Int =
|
|
|
|
|
@ -777,6 +847,87 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
|
|
|
|
|
btnMinimize.layoutParams = btnMinimizeLayoutParam
|
|
|
|
|
mCallBtn.layoutParams = mCallBtnLayoutParam
|
|
|
|
|
|
|
|
|
|
handleVideoViewHeight(isFullScreen)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun handleVideoViewHeight(isFullScreen: Boolean) {
|
|
|
|
|
val layoutNameParam: ConstraintLayout.LayoutParams =
|
|
|
|
|
layoutName.layoutParams as ConstraintLayout.LayoutParams
|
|
|
|
|
val layoutMiniParam: ConstraintLayout.LayoutParams =
|
|
|
|
|
layoutMini.layoutParams as ConstraintLayout.LayoutParams
|
|
|
|
|
val controlPanelParam: ConstraintLayout.LayoutParams =
|
|
|
|
|
controlPanel.layoutParams as ConstraintLayout.LayoutParams
|
|
|
|
|
|
|
|
|
|
val layoutNameHeight: Int =
|
|
|
|
|
context!!.resources.getDimension(R.dimen.layout_name_height).toInt()
|
|
|
|
|
val layoutMiniHeight: Int =
|
|
|
|
|
context!!.resources.getDimension(R.dimen.layout_mini_height).toInt()
|
|
|
|
|
val panelHeight: Int = context!!.resources.getDimension(R.dimen.layout_panel_height).toInt()
|
|
|
|
|
val panelHeightSmall: Int =
|
|
|
|
|
context!!.resources.getDimension(R.dimen.layout_panel_height_small).toInt()
|
|
|
|
|
|
|
|
|
|
val panelPadding: Int =
|
|
|
|
|
context!!.resources.getDimension(R.dimen.padding_space_big).toInt()
|
|
|
|
|
val panelPaddingMedium: Int =
|
|
|
|
|
context!!.resources.getDimension(R.dimen.padding_space_medium).toInt()
|
|
|
|
|
|
|
|
|
|
val temp = getStatusBarHeight() / 2
|
|
|
|
|
|
|
|
|
|
val screenWidth: Float
|
|
|
|
|
val screenHeight: Float
|
|
|
|
|
|
|
|
|
|
if (isFullScreen) {
|
|
|
|
|
screenWidth = ViewsUtil.getWidthDp(requireContext())
|
|
|
|
|
screenHeight = ViewsUtil.getHeightDp(requireContext())
|
|
|
|
|
|
|
|
|
|
layoutNameParam.height = layoutNameHeight + temp
|
|
|
|
|
layoutMiniParam.height = 0
|
|
|
|
|
controlPanelParam.height = panelHeight + temp
|
|
|
|
|
|
|
|
|
|
controlPanel.setPadding(panelPadding, panelPadding, panelPadding, panelPadding)
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if (isCircle) {
|
|
|
|
|
screenWidth = 300F
|
|
|
|
|
screenHeight = 300F
|
|
|
|
|
|
|
|
|
|
layoutNameParam.height = 0
|
|
|
|
|
layoutMiniParam.height = 0
|
|
|
|
|
controlPanelParam.height = 0
|
|
|
|
|
} else {
|
|
|
|
|
screenWidth = 400F
|
|
|
|
|
screenHeight = 600F
|
|
|
|
|
|
|
|
|
|
layoutNameParam.height = 0
|
|
|
|
|
layoutMiniParam.height = layoutMiniHeight
|
|
|
|
|
controlPanelParam.height = panelHeightSmall
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
controlPanel.setPadding(
|
|
|
|
|
panelPaddingMedium,
|
|
|
|
|
panelPaddingMedium,
|
|
|
|
|
panelPaddingMedium,
|
|
|
|
|
panelPaddingMedium
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
layoutName.layoutParams = layoutNameParam
|
|
|
|
|
layoutMini.layoutParams = layoutMiniParam
|
|
|
|
|
controlPanel.layoutParams = controlPanelParam
|
|
|
|
|
|
|
|
|
|
var videoStreamHeight =
|
|
|
|
|
screenHeight - controlPanelParam.height - layoutNameParam.height - layoutMiniParam.height
|
|
|
|
|
|
|
|
|
|
if (isFullScreen) {
|
|
|
|
|
// videoStreamHeight -= getStatusBarHeight() / 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val callLayoutParam: ConstraintLayout.LayoutParams =
|
|
|
|
|
activity_clingo_video_call.layoutParams as ConstraintLayout.LayoutParams
|
|
|
|
|
|
|
|
|
|
callLayoutParam.height = videoStreamHeight.toInt()
|
|
|
|
|
callLayoutParam.width = screenWidth.toInt()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun onCameraClicked(view: View?) {
|
|
|
|
|
@ -784,7 +935,15 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
isCameraClicked = !isCameraClicked
|
|
|
|
|
mPublisher!!.publishVideo = !isCameraClicked
|
|
|
|
|
val res = if (isCameraClicked) R.drawable.video_disabled else R.drawable.video_enabled
|
|
|
|
|
mCameraBtn!!.setImageResource(res)
|
|
|
|
|
mCameraBtn.setImageResource(res)
|
|
|
|
|
|
|
|
|
|
// if (!isCameraClicked) {
|
|
|
|
|
// videoCallContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
|
|
|
|
|
// mSubscriberViewContainer.background = ContextCompat.getDrawable(requireContext(), R.drawable.circle_shape)
|
|
|
|
|
// } else {
|
|
|
|
|
// videoCallContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.text_color))
|
|
|
|
|
// mSubscriberViewContainer.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.remoteBackground))
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -910,7 +1069,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session
|
|
|
|
|
mParams.x =
|
|
|
|
|
(szWindow.x - current_x_cord * current_x_cord * step - videoCallContainer.width).toInt()
|
|
|
|
|
|
|
|
|
|
dialog!!.window!!.attributes = mParams
|
|
|
|
|
dialog?.window?.attributes = mParams
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onFinish() {
|
|
|
|
|
|