Commit 0e366aa8 by 刘鹏

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

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