Commit 0e366aa8 by 刘鹏

feat : 收到邀请跳转接听界面,未加入中转界面

parent f63843d3
......@@ -31,7 +31,11 @@
android:enabled="true"
android:exported="false" />
<activity android:name="com.tencent.liteav.videocall.VideoCallingActivity"/>
<activity
android:name="com.tencent.liteav.videocall.VideoCallingActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />
</application>
......
......@@ -9,6 +9,8 @@ import android.text.TextUtils;
import android.util.Log;
import com.blankj.utilcode.util.ToastUtils;
import com.tencent.liteav.basic.UserModel;
import com.tencent.liteav.basic.UserModelManager;
import com.tencent.liteav.trtccalling.model.TRTCCalling;
import com.tencent.liteav.trtccalling.model.TRTCCallingDelegate;
import com.tencent.liteav.trtccalling.model.impl.TRTCCallingCallback;
......@@ -22,6 +24,8 @@ import com.tencent.liteav.trtccalling.ui.base.Status;
import com.tencent.liteav.trtccalling.ui.service.TUICallService;
import com.tencent.liteav.trtccalling.ui.videocall.TUICallVideoView;
import com.tencent.liteav.trtccalling.ui.videocall.TUIGroupCallVideoView;
import com.tencent.liteav.videocall.Constant;
import com.tencent.liteav.videocall.VideoCallingActivity;
import com.tencent.trtc.TRTCCloudDef;
import java.util.ArrayList;
......@@ -114,7 +118,13 @@ public final class TUICallingImpl implements TUICalling, TRTCCallingDelegate {
}
@Override
public void internalCall(final String[] userIDs, final String sponsorID, final String groupID) {
internalCall(userIDs,sponsorID,groupID,true,Type.VIDEO,Role.CALLED);
// internalCall(userIDs,sponsorID,groupID,true,Type.VIDEO,Role.CALLED);
final UserModel userModel = UserModelManager.getInstance().getUserModel();
// Intent intent = new Intent(mContext, VideoCallingActivity.class);
// intent.putExtra(Constant.ROOM_ID, groupID);
// intent.putExtra(Constant.USER_ID, userModel.userId);
// mContext.startActivity(intent);
}
void internalCall(final String[] userIDs, final String sponsorID, final String groupID, final boolean isFromGroup, final Type type, final Role role) {
......@@ -164,18 +174,25 @@ public final class TUICallingImpl implements TUICalling, TRTCCallingDelegate {
Runnable task = new Runnable() {
@Override
public void run() {
Intent intent = new Intent(mContext, BaseCallActivity.class);
intent.putExtra(TUICallingConstants.PARAM_NAME_TYPE, type);
intent.putExtra(TUICallingConstants.PARAM_NAME_ROLE, role);
if (Role.CALLED == role) {
intent.putExtra(TUICallingConstants.PARAM_NAME_SPONSORID, sponsorID);
intent.putExtra(TUICallingConstants.PARAM_NAME_ISFROMGROUP, isFromGroup);
}
intent.putExtra(TUICallingConstants.PARAM_NAME_USERIDS, userIDs);
intent.putExtra(TUICallingConstants.PARAM_NAME_GROUPID, groupID);
intent.putExtra(TUICallingConstants.PARAM_NAME_FLOATWINDOW, mEnableFloatWindow);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
final UserModel userModel = UserModelManager.getInstance().getUserModel();
// Intent intent = new Intent(mContext, VideoCallingActivity.class);
// intent.putExtra(Constant.ROOM_ID, groupID);
// intent.putExtra(Constant.USER_ID, userModel.userId);
// mContext.startActivity(intent);
// Intent intent = new Intent(mContext, BaseCallActivity.class);
// intent.putExtra(TUICallingConstants.PARAM_NAME_TYPE, type);
// intent.putExtra(TUICallingConstants.PARAM_NAME_ROLE, role);
// if (Role.CALLED == role) {
// intent.putExtra(TUICallingConstants.PARAM_NAME_SPONSORID, sponsorID);
// intent.putExtra(TUICallingConstants.PARAM_NAME_ISFROMGROUP, isFromGroup);
// }
// intent.putExtra(TUICallingConstants.PARAM_NAME_USERIDS, userIDs);
// intent.putExtra(TUICallingConstants.PARAM_NAME_GROUPID, groupID);
// intent.putExtra(TUICallingConstants.PARAM_NAME_FLOATWINDOW, mEnableFloatWindow);
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// mContext.startActivity(intent);
}
};
mMainHandler.post(task);
......
......@@ -2,6 +2,7 @@ package com.tencent.liteav.trtccalling.model;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
......@@ -30,6 +31,8 @@ import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
import com.tencent.imsdk.v2.V2TIMUserFullInfo;
import com.tencent.imsdk.v2.V2TIMUserInfo;
import com.tencent.imsdk.v2.V2TIMValueCallback;
import com.tencent.liteav.basic.UserModel;
import com.tencent.liteav.basic.UserModelManager;
import com.tencent.liteav.beauty.TXBeautyManager;
import com.tencent.liteav.trtccalling.R;
import com.tencent.liteav.trtccalling.model.impl.TRTCCallingCallback;
......@@ -43,6 +46,8 @@ import com.tencent.liteav.trtccalling.model.impl.base.TRTCLogger;
import com.tencent.liteav.trtccalling.model.util.MediaPlayHelper;
import com.tencent.liteav.trtccalling.model.util.PermissionUtil;
import com.tencent.liteav.trtccalling.model.util.TUICallingConstants;
import com.tencent.liteav.videocall.Constant;
import com.tencent.liteav.videocall.VideoCallingActivity;
import com.tencent.qcloud.tuicore.TUILogin;
import com.tencent.rtmp.TXLiveBase;
import com.tencent.rtmp.ui.TXCloudVideoView;
......@@ -317,7 +322,16 @@ public class TRTCCalling {
List<String> inviteeList, String data) {
TRTCLogger.d(TAG, "onReceiveNewInvitation inviteID:" + inviteID + ", inviter:" + inviter
+ ", groupID:" + groupID + ", inviteeList:" + inviteeList + " data:" + data);
handleRecvCallModel(inviteID, inviter, groupID, inviteeList, data);
final UserModel userModel = UserModelManager.getInstance().getUserModel();
Intent intent = new Intent(mContext, VideoCallingActivity.class);
intent.putExtra(Constant.ROOM_ID, groupID);
intent.putExtra(Constant.USER_ID, userModel.userId);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
// handleRecvCallModel(inviteID, inviter, groupID, inviteeList, data);
}
@Override
......@@ -1153,7 +1167,13 @@ public class TRTCCalling {
if (isCollectionEmpty(userIdList)) {
return;
}
internalCall(userIdList, type, groupId);
final UserModel userModel = UserModelManager.getInstance().getUserModel();
Intent intent = new Intent(mContext, VideoCallingActivity.class);
intent.putExtra(Constant.ROOM_ID, groupId);
intent.putExtra(Constant.USER_ID, userModel.userId);
mContext.startActivity(intent);
// internalCall(userIdList, type, groupId);
}
/**
......@@ -1171,7 +1191,7 @@ public class TRTCCalling {
mCurCallType = type;
mIsBeingCalled = false;
TRTCLogger.d(TAG, "First calling, generate room id " + mCurRoomID);
enterTRTCRoom(mCurRoomID,mCurCallType);
enterTRTCRoom(mCurRoomID, mCurCallType);
startCall();
startDialingMusic();
}
......@@ -1255,14 +1275,14 @@ public class TRTCCalling {
public void accept() {
mIsProcessedBySelf = true;
enterTRTCRoom(mCurRoomID,mCurCallType);
enterTRTCRoom(mCurRoomID, mCurCallType);
stopRing();
}
/**
* trtc 进房
*/
public void enterTRTCRoom(int roomId,int callType) {
public void enterTRTCRoom(int roomId, int callType) {
if (callType == TYPE_VIDEO_CALL) {
// 开启基础美颜
TXBeautyManager txBeautyManager = mTRTCCloud.getBeautyManager();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment