|
|
@ -14,6 +14,7 @@ import android.widget.ImageView; |
|
|
|
import android.widget.LinearLayout; |
|
|
|
import android.widget.LinearLayout; |
|
|
|
import android.widget.TextView; |
|
|
|
import android.widget.TextView; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull; |
|
|
|
import androidx.annotation.Nullable; |
|
|
|
import androidx.annotation.Nullable; |
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout; |
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout; |
|
|
|
import androidx.lifecycle.Observer; |
|
|
|
import androidx.lifecycle.Observer; |
|
|
@ -25,6 +26,8 @@ import com.blankj.utilcode.util.StringUtils; |
|
|
|
import com.blankj.utilcode.util.ToastUtils; |
|
|
|
import com.blankj.utilcode.util.ToastUtils; |
|
|
|
import com.bumptech.glide.Glide; |
|
|
|
import com.bumptech.glide.Glide; |
|
|
|
import com.bumptech.glide.request.RequestOptions; |
|
|
|
import com.bumptech.glide.request.RequestOptions; |
|
|
|
|
|
|
|
import com.chad.library.adapter.base.BaseQuickAdapter; |
|
|
|
|
|
|
|
import com.chad.library.adapter.base.listener.OnItemClickListener; |
|
|
|
import com.hjq.http.EasyHttp; |
|
|
|
import com.hjq.http.EasyHttp; |
|
|
|
import com.hjq.http.listener.OnHttpListener; |
|
|
|
import com.hjq.http.listener.OnHttpListener; |
|
|
|
import com.unionmed.unionmedtv.R; |
|
|
|
import com.unionmed.unionmedtv.R; |
|
|
@ -38,6 +41,9 @@ import com.unionmed.unionmedtv.livedatas.LiveDataBus; |
|
|
|
import com.unionmed.unionmedtv.network.ApiResponse; |
|
|
|
import com.unionmed.unionmedtv.network.ApiResponse; |
|
|
|
import com.unionmed.unionmedtv.utils.CacheUtil; |
|
|
|
import com.unionmed.unionmedtv.utils.CacheUtil; |
|
|
|
import com.unionmed.unionmedtv.utils.Constants; |
|
|
|
import com.unionmed.unionmedtv.utils.Constants; |
|
|
|
|
|
|
|
import com.unionmed.unionmedtv.utils.OnChildClickListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
@ -104,13 +110,17 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
this.usetInfo = usetInfo; |
|
|
|
this.usetInfo = usetInfo; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//本地视频全屏数据
|
|
|
|
private String imgPath = ""; |
|
|
|
private String imgPath = ""; |
|
|
|
private String name = ""; |
|
|
|
private String name = ""; |
|
|
|
|
|
|
|
private String localId = ""; |
|
|
|
|
|
|
|
private SurfaceView surfaceView = null; |
|
|
|
|
|
|
|
private boolean cameraDisabled = false; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* idle 通话结束 |
|
|
|
* idle 通话结束 |
|
|
|
* Calling 电话拨出 |
|
|
|
* Calling 电话拨出 |
|
|
|
* BeCall 代接听 |
|
|
|
* BeCall 等待接听 |
|
|
|
* OnCall 已接通 |
|
|
|
* OnCall 已接通 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public enum CallStatus { |
|
|
|
public enum CallStatus { |
|
|
@ -141,7 +151,32 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
tv_time = findViewById(R.id.tv_time); |
|
|
|
tv_time = findViewById(R.id.tv_time); |
|
|
|
recyclerView = findViewById(R.id.recyclerView); |
|
|
|
recyclerView = findViewById(R.id.recyclerView); |
|
|
|
recyclerView.setLayoutManager(new LinearLayoutManager(VideoCallActivity.this)); |
|
|
|
recyclerView.setLayoutManager(new LinearLayoutManager(VideoCallActivity.this)); |
|
|
|
remoteAdapter = new RemoteAdapter(R.layout.item_remote_layout); |
|
|
|
remoteAdapter = new RemoteAdapter(R.layout.item_remote_layout, new OnChildClickListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public <T> void onChildClick(View view, int position, T data) { |
|
|
|
|
|
|
|
RemoteBean newRemoteBean = new RemoteBean(); |
|
|
|
|
|
|
|
newRemoteBean.setPath(imgPath); |
|
|
|
|
|
|
|
newRemoteBean.setName(name); |
|
|
|
|
|
|
|
((RCRTCVideoView) surfaceView).setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL); |
|
|
|
|
|
|
|
newRemoteBean.setSurfaceView(surfaceView); |
|
|
|
|
|
|
|
newRemoteBean.setUserId(localId); |
|
|
|
|
|
|
|
newRemoteBean.setCameraDisabled(cameraDisabled); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
((FrameLayout) ((RemoteBean) data).getView()).removeAllViews(); |
|
|
|
|
|
|
|
RemoteBean remoteBean = (RemoteBean) data; |
|
|
|
|
|
|
|
imgPath = remoteBean.getPath(); |
|
|
|
|
|
|
|
name = remoteBean.getName(); |
|
|
|
|
|
|
|
localId = remoteBean.getUserId(); |
|
|
|
|
|
|
|
cameraDisabled = remoteBean.isCameraDisabled(); |
|
|
|
|
|
|
|
surfaceView = remoteBean.getSurfaceView(); |
|
|
|
|
|
|
|
surfaceView.setZOrderOnTop(false); |
|
|
|
|
|
|
|
clearViews(); |
|
|
|
|
|
|
|
addLocalView(surfaceView); |
|
|
|
|
|
|
|
remoteAdapter.getData().set(position, newRemoteBean); |
|
|
|
|
|
|
|
remoteAdapter.notifyDataSetChanged(); |
|
|
|
|
|
|
|
chageCamera(!cameraDisabled); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
recyclerView.setAdapter(remoteAdapter); |
|
|
|
recyclerView.setAdapter(remoteAdapter); |
|
|
|
lin_put_through = findViewById(R.id.lin_put_through); |
|
|
|
lin_put_through = findViewById(R.id.lin_put_through); |
|
|
|
lin_put_through.setOnClickListener(this); |
|
|
|
lin_put_through.setOnClickListener(this); |
|
|
@ -155,25 +190,28 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
lin_mute.setSelected(true); |
|
|
|
lin_mute.setSelected(true); |
|
|
|
|
|
|
|
|
|
|
|
initIRongCallListener(); |
|
|
|
initIRongCallListener(); |
|
|
|
type =getIntent().getStringExtra("type"); |
|
|
|
type = getIntent().getStringExtra("type"); |
|
|
|
targetId = getIntent().getStringExtra("targetId"); |
|
|
|
targetId = getIntent().getStringExtra("targetId"); |
|
|
|
|
|
|
|
localId = targetId; |
|
|
|
groupId = getIntent().getStringExtra("groupId"); |
|
|
|
groupId = getIntent().getStringExtra("groupId"); |
|
|
|
if(type.equals("1")){ |
|
|
|
if (type.equals("1")) { |
|
|
|
if (!TextUtils.isEmpty(targetId)) { |
|
|
|
if (!TextUtils.isEmpty(targetId)) { |
|
|
|
List<String> userIds = new ArrayList<>(); |
|
|
|
List<String> userIds = new ArrayList<>(); |
|
|
|
userIds.add(targetId); |
|
|
|
userIds.add(targetId); |
|
|
|
RongCallClient.getInstance().startCall(Conversation.ConversationType.GROUP, groupId, |
|
|
|
RongCallClient.getInstance().startCall(Conversation.ConversationType.GROUP, groupId, |
|
|
|
userIds, null, RongCallCommon.CallMediaType.VIDEO, null); |
|
|
|
userIds, null, RongCallCommon.CallMediaType.VIDEO, null); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
changeUi(null); |
|
|
|
changeUi(null); |
|
|
|
} |
|
|
|
} |
|
|
|
getUserInfoByServer(targetId); |
|
|
|
getUserInfoByServer(targetId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private long time = 0; |
|
|
|
private long time = 0; |
|
|
|
Handler handler; |
|
|
|
Handler handler; |
|
|
|
|
|
|
|
|
|
|
|
private void reckonByTime() { |
|
|
|
private void reckonByTime() { |
|
|
|
handler = new Handler(); |
|
|
|
handler = new Handler(); |
|
|
|
Runnable updateTask = new Runnable() { |
|
|
|
Runnable updateTask = new Runnable() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
@ -193,16 +231,20 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
// 延迟执行任务
|
|
|
|
// 延迟执行任务
|
|
|
|
handler.postDelayed(updateTask, 1000); |
|
|
|
handler.postDelayed(updateTask, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void addLocalView(SurfaceView view) { |
|
|
|
|
|
|
|
local.removeAllViews(); |
|
|
|
|
|
|
|
((RCRTCVideoView) view).setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL); |
|
|
|
|
|
|
|
local.addView(view); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void clearViews() { |
|
|
|
|
|
|
|
local.removeAllViews(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void initIRongCallListener() { |
|
|
|
public void initIRongCallListener() { |
|
|
|
RongCallClient.getInstance().setVoIPCallListener(new IRongCallListener() { |
|
|
|
RongCallClient.getInstance().setVoIPCallListener(new IRongCallListener() { |
|
|
|
private void addLocalView(SurfaceView view) { |
|
|
|
|
|
|
|
local.removeAllViews(); |
|
|
|
|
|
|
|
local.addView(view); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void clearViews() { |
|
|
|
|
|
|
|
local.removeAllViews(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 电话已拨出。 |
|
|
|
* 电话已拨出。 |
|
|
@ -213,7 +255,7 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onCallOutgoing(RongCallSession callSession, SurfaceView localVideo) { |
|
|
|
public void onCallOutgoing(RongCallSession callSession, SurfaceView localVideo) { |
|
|
|
Log.i("TAG", "onCallOutgoing: ================="+callSession.getActiveTime()); |
|
|
|
Log.i("TAG", "onCallOutgoing: =================" + callSession.getActiveTime()); |
|
|
|
currentStatus = CallStatus.Calling; |
|
|
|
currentStatus = CallStatus.Calling; |
|
|
|
changeUi(null); |
|
|
|
changeUi(null); |
|
|
|
} |
|
|
|
} |
|
|
@ -231,11 +273,13 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
currentStatus = CallStatus.OnCall; |
|
|
|
currentStatus = CallStatus.OnCall; |
|
|
|
changeUi(null); |
|
|
|
changeUi(null); |
|
|
|
RemoteBean remoteBean = new RemoteBean(); |
|
|
|
RemoteBean remoteBean = new RemoteBean(); |
|
|
|
remoteBean.setUserId(targetId); |
|
|
|
remoteBean.setUserId(CacheUtil.getImUserAccount()); |
|
|
|
|
|
|
|
((RCRTCVideoView) localVideo).setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL); |
|
|
|
remoteBean.setSurfaceView(localVideo); |
|
|
|
remoteBean.setSurfaceView(localVideo); |
|
|
|
remoteAdapter.addData(remoteBean); |
|
|
|
|
|
|
|
remoteBean.setPath(CacheUtil.getToken().getHeadImg()); |
|
|
|
remoteBean.setPath(CacheUtil.getToken().getHeadImg()); |
|
|
|
remoteBean.setName(CacheUtil.getToken().getName()); |
|
|
|
remoteBean.setName(CacheUtil.getToken().getName()); |
|
|
|
|
|
|
|
remoteAdapter.addData(remoteBean); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -294,23 +338,28 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void success(ImUserInfoBean imUserInfoBean) { |
|
|
|
public void success(ImUserInfoBean imUserInfoBean) { |
|
|
|
if (userId.equals(targetId)) { |
|
|
|
if (userId.equals(targetId)) { |
|
|
|
((RCRTCVideoView)remoteVideo).setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL); |
|
|
|
surfaceView = remoteVideo; |
|
|
|
|
|
|
|
((RCRTCVideoView) remoteVideo).setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL); |
|
|
|
addLocalView(remoteVideo); |
|
|
|
addLocalView(remoteVideo); |
|
|
|
imgPath = imUserInfoBean.getHeadImg(); |
|
|
|
imgPath = imUserInfoBean.getHeadImg(); |
|
|
|
name = imUserInfoBean.getName(); |
|
|
|
name = imUserInfoBean.getName(); |
|
|
|
|
|
|
|
localId = targetId; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
RemoteBean remoteBean = new RemoteBean(); |
|
|
|
RemoteBean remoteBean = new RemoteBean(); |
|
|
|
remoteBean.setUserId(userId); |
|
|
|
remoteBean.setUserId(userId); |
|
|
|
|
|
|
|
((RCRTCVideoView) remoteVideo).setScalingType(RendererCommon.ScalingType.SCALE_ASPECT_FILL); |
|
|
|
remoteBean.setSurfaceView(remoteVideo); |
|
|
|
remoteBean.setSurfaceView(remoteVideo); |
|
|
|
remoteAdapter.addData(remoteBean); |
|
|
|
|
|
|
|
remoteBean.setPath(imUserInfoBean.getHeadImg()); |
|
|
|
remoteBean.setPath(imUserInfoBean.getHeadImg()); |
|
|
|
remoteBean.setName(imUserInfoBean.getName()); |
|
|
|
remoteBean.setName(imUserInfoBean.getName()); |
|
|
|
|
|
|
|
remoteAdapter.addData(remoteBean); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void fail() { |
|
|
|
public void fail() { |
|
|
|
if (userId.equals(targetId)) { |
|
|
|
if (userId.equals(targetId)) { |
|
|
|
|
|
|
|
surfaceView = remoteVideo; |
|
|
|
addLocalView(remoteVideo); |
|
|
|
addLocalView(remoteVideo); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
RemoteBean remoteBean = new RemoteBean(); |
|
|
|
RemoteBean remoteBean = new RemoteBean(); |
|
|
@ -361,7 +410,8 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onRemoteCameraDisabled(String userId, boolean disabled) { |
|
|
|
public void onRemoteCameraDisabled(String userId, boolean disabled) { |
|
|
|
if (userId.equals(targetId)) { |
|
|
|
if (userId.equals(localId)) { |
|
|
|
|
|
|
|
cameraDisabled = disabled; |
|
|
|
if (disabled) { |
|
|
|
if (disabled) { |
|
|
|
local.setVisibility(View.GONE); |
|
|
|
local.setVisibility(View.GONE); |
|
|
|
iv_icon.setVisibility(View.VISIBLE); |
|
|
|
iv_icon.setVisibility(View.VISIBLE); |
|
|
@ -493,20 +543,22 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
.api(new GetImUserInfoApi(CacheUtil.getToken().getToken(), userId)) |
|
|
|
.api(new GetImUserInfoApi(CacheUtil.getToken().getToken(), userId)) |
|
|
|
.request(new OnHttpListener<ApiResponse<ApiResponse<ImUserInfoBean>>>() { |
|
|
|
.request(new OnHttpListener<ApiResponse<ApiResponse<ImUserInfoBean>>>() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onSucceed(ApiResponse<ApiResponse<ImUserInfoBean>> result) { |
|
|
|
public void onHttpSuccess(ApiResponse<ApiResponse<ImUserInfoBean>> result) { |
|
|
|
if (null != result.getData() && result.getData().isInnerRequestSucceed() |
|
|
|
if (null != result.getData() && result.getData().isInnerRequestSucceed() |
|
|
|
&& null != result.getData().getData()) { |
|
|
|
&& null != result.getData().getData()) { |
|
|
|
Glide.with(VideoCallActivity.this) |
|
|
|
if (currentStatus != CallStatus.OnCall) { //等待接听状态
|
|
|
|
.load(result.getData().getData().getHeadImg()) |
|
|
|
Glide.with(VideoCallActivity.this) |
|
|
|
.apply(new RequestOptions() |
|
|
|
.load(result.getData().getData().getHeadImg()) |
|
|
|
.placeholder(R.color.white_e1e1e1) |
|
|
|
.apply(new RequestOptions() |
|
|
|
) |
|
|
|
.placeholder(R.color.white_e1e1e1) |
|
|
|
.into(iv_icon); |
|
|
|
) |
|
|
|
tv_name.setText(result.getData().getData().getName()); |
|
|
|
.into(iv_icon); |
|
|
|
if (type.equals("1")) { |
|
|
|
tv_name.setText(result.getData().getData().getName()); |
|
|
|
tv_tip.setText("等待对方接听"); |
|
|
|
if (type.equals("1")) { |
|
|
|
} else { |
|
|
|
tv_tip.setText("等待对方接听"); |
|
|
|
tv_tip.setText("对方邀请您进行通话"); |
|
|
|
} else { |
|
|
|
|
|
|
|
tv_tip.setText("对方邀请您进行通话"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (usetInfo != null) { |
|
|
|
if (usetInfo != null) { |
|
|
|
usetInfo.success(result.getData().getData()); |
|
|
|
usetInfo.success(result.getData().getData()); |
|
|
@ -520,19 +572,21 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onFail(Exception e) { |
|
|
|
public void onHttpFail(Exception e) { |
|
|
|
|
|
|
|
ToastUtils.showLong(e.getMessage()); |
|
|
|
LogUtils.e("用户信息失败", "失败:" + e); |
|
|
|
LogUtils.e("用户信息失败", "失败:" + e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onClick(View view) { |
|
|
|
public void onClick(View view) { |
|
|
|
if (view.getId() == R.id.lin_put_through||view.getId()==R.id.iv_put_through) {//接听
|
|
|
|
if (view.getId() == R.id.lin_put_through || view.getId() == R.id.iv_put_through) {//接听
|
|
|
|
if (RongCallClient.getInstance() != null && RongCallClient.getInstance().getCallSession() != null) { |
|
|
|
if (RongCallClient.getInstance() != null && RongCallClient.getInstance().getCallSession() != null) { |
|
|
|
RongCallClient.getInstance().acceptCall(RongCallClient.getInstance().getCallSession().getCallId()); |
|
|
|
RongCallClient.getInstance().acceptCall(RongCallClient.getInstance().getCallSession().getCallId()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (view.getId() == R.id.lin_hang_up||view.getId()==R.id.iv_hang_up) {//挂断
|
|
|
|
} else if (view.getId() == R.id.lin_hang_up || view.getId() == R.id.iv_hang_up) {//挂断
|
|
|
|
if (RongCallClient.getInstance() != null && RongCallClient.getInstance().getCallSession() != null) { |
|
|
|
if (RongCallClient.getInstance() != null && RongCallClient.getInstance().getCallSession() != null) { |
|
|
|
RongCallClient.getInstance().hangUpCall(RongCallClient.getInstance().getCallSession().getCallId()); |
|
|
|
RongCallClient.getInstance().hangUpCall(RongCallClient.getInstance().getCallSession().getCallId()); |
|
|
|
} |
|
|
|
} |
|
|
@ -561,20 +615,49 @@ public class VideoCallActivity extends BaseActivity implements View.OnClickListe |
|
|
|
iv_camera.setImageDrawable(getResources().getDrawable(R.mipmap.icon_camera_on)); |
|
|
|
iv_camera.setImageDrawable(getResources().getDrawable(R.mipmap.icon_camera_on)); |
|
|
|
tv_camera.setText("摄像头已开"); |
|
|
|
tv_camera.setText("摄像头已开"); |
|
|
|
} |
|
|
|
} |
|
|
|
for (int i = 0; i < remoteAdapter.getData().size(); i++) { |
|
|
|
if (localId.equals(CacheUtil.getImUserAccount())) {//本地大屏用户id==当前账号id
|
|
|
|
if (remoteAdapter.getData().get(i).getUserId().equals(targetId)) { |
|
|
|
cameraDisabled = !lin_turn_off_camera.isSelected(); |
|
|
|
remoteAdapter.getData().get(i).setCameraDisabled(!lin_turn_off_camera.isSelected()); |
|
|
|
chageCamera(!cameraDisabled); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
for (int i = 0; i < remoteAdapter.getData().size(); i++) { |
|
|
|
|
|
|
|
if (remoteAdapter.getData().get(i).getUserId().equals(CacheUtil.getImUserAccount())) { |
|
|
|
|
|
|
|
remoteAdapter.getData().get(i).setCameraDisabled(!lin_turn_off_camera.isSelected()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
remoteAdapter.notifyDataSetChanged(); |
|
|
|
} |
|
|
|
} |
|
|
|
remoteAdapter.notifyDataSetChanged(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//本地视频图像显示
|
|
|
|
|
|
|
|
public void chageCamera(boolean cameraDisabled) { |
|
|
|
|
|
|
|
if (!cameraDisabled) { |
|
|
|
|
|
|
|
local.setVisibility(View.GONE); |
|
|
|
|
|
|
|
iv_icon.setVisibility(View.VISIBLE); |
|
|
|
|
|
|
|
Glide.with(VideoCallActivity.this) |
|
|
|
|
|
|
|
.load(imgPath) |
|
|
|
|
|
|
|
.apply(new RequestOptions() |
|
|
|
|
|
|
|
.placeholder(R.mipmap.rc_default_portrait) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
.into(iv_icon); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
local.setVisibility(View.VISIBLE); |
|
|
|
|
|
|
|
iv_icon.setVisibility(View.GONE); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void onDestroy() { |
|
|
|
protected void onDestroy() { |
|
|
|
super.onDestroy(); |
|
|
|
super.onDestroy(); |
|
|
|
if(handler!=null){ |
|
|
|
if (handler != null) { |
|
|
|
handler.removeCallbacksAndMessages(null); |
|
|
|
handler.removeCallbacksAndMessages(null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onBackPressed() { |
|
|
|
|
|
|
|
if (RongCallClient.getInstance() != null && RongCallClient.getInstance().getCallSession() != null) { |
|
|
|
|
|
|
|
RongCallClient.getInstance().hangUpCall(RongCallClient.getInstance().getCallSession().getCallId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|