|
@@ -217,6 +217,10 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
|
}
|
|
|
|
|
|
private fun showCalling(audioOnly: Boolean) {
|
|
|
+ if (callEnded) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (audioOnly) {
|
|
|
//移除视频画面
|
|
|
fullscreen_video_frame.visibility = View.GONE
|
|
@@ -352,15 +356,20 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
|
}
|
|
|
|
|
|
if (outGoing && remoteSurfaceView == null) {
|
|
|
- if (fullscreen_video_frame != null && fullscreen_video_frame.getChildCount() != 0) {
|
|
|
- fullscreen_video_frame.removeAllViews()
|
|
|
+ if (fullscreen_video_frame != null) {
|
|
|
+ if (fullscreen_video_frame.getChildCount() != 0) {
|
|
|
+ fullscreen_video_frame.removeAllViews()
|
|
|
+ }
|
|
|
+ fullscreen_video_frame.addView(localSurfaceView)
|
|
|
}
|
|
|
- fullscreen_video_frame.addView(localSurfaceView)
|
|
|
+
|
|
|
} else {
|
|
|
- if (pip_video_frame != null && pip_video_frame.getChildCount() != 0) {
|
|
|
- pip_video_frame.removeAllViews()
|
|
|
+ if (pip_video_frame != null) {
|
|
|
+ if (pip_video_frame.getChildCount() != 0) {
|
|
|
+ pip_video_frame.removeAllViews()
|
|
|
+ }
|
|
|
+ pip_video_frame.addView(localSurfaceView)
|
|
|
}
|
|
|
- pip_video_frame.addView(localSurfaceView)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -379,14 +388,16 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
|
if (localSurfaceView!!.parent != null) {
|
|
|
(localSurfaceView!!.parent as ViewGroup).removeView(localSurfaceView)
|
|
|
}
|
|
|
- pip_video_frame!!.addView(localSurfaceView)
|
|
|
+ if (pip_video_frame != null) {
|
|
|
+ pip_video_frame.addView(localSurfaceView)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//远端画面
|
|
|
val surfaceView = gEngineKit!!.currentSession.setupRemoteVideo(userId, false)
|
|
|
Log.e("dds", "didReceiveRemoteVideoTrack,surfaceView = $surfaceView")
|
|
|
- if (surfaceView != null) {
|
|
|
+ if (surfaceView != null && fullscreen_video_frame != null) {
|
|
|
remoteSurfaceView = surfaceView as SurfaceViewRenderer
|
|
|
fullscreen_video_frame.removeAllViews()
|
|
|
if (remoteSurfaceView!!.parent != null) {
|
|
@@ -400,7 +411,7 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
|
|
|
|
override fun didCallEndWithReason(callEndReason: EnumType.CallEndReason?) {
|
|
|
handler.post {
|
|
|
- when (callEndReason) {
|
|
|
+ /*when (callEndReason) {
|
|
|
EnumType.CallEndReason.Busy -> {
|
|
|
showMessage("对方忙线中")
|
|
|
}
|
|
@@ -428,8 +439,9 @@ class SkyCallFragment: BaseCallFragment(), CallSession.CallSessionCallback {
|
|
|
EnumType.CallEndReason.Timeout -> {
|
|
|
showMessage("对方未接听")
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
+ showMessage("通话结束")
|
|
|
callEnd()
|
|
|
}
|
|
|
}
|