Commit f02775dc by upwork.021

feat: 通话组件升级

parent bec981f5
...@@ -33,8 +33,8 @@ ext { ...@@ -33,8 +33,8 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.9", "ydl-tuicore" : "0.0.12",
"m-tuicore-ydl" : "0.0.10", // "m-tuicore-ydl" : "0.0.10",
//第一步 //第一步
"ydl-platform" : "0.0.40.90", "ydl-platform" : "0.0.40.90",
......
...@@ -47,15 +47,15 @@ dependencies { ...@@ -47,15 +47,15 @@ dependencies {
implementation(rootProject.ext.dependencies["okhttp3"]) implementation(rootProject.ext.dependencies["okhttp3"])
implementation(rootProject.ext.dependencies["glide"]) implementation(rootProject.ext.dependencies["glide"])
implementation(rootProject.ext.dependencies["gson"]) implementation(rootProject.ext.dependencies["gson"])
if (rootProject.ext.dev_mode){ // if (rootProject.ext.dev_mode){
//开发时使用 // //开发时使用
api project(':ydl-platform') // implementation project(':ydl-platform')
}else { // }else {
//发布时使用 // //发布时使用
api(rootProject.ext.dependencies["ydl-platform"]) { // implementation(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true // transitive = true
} // }
} // }
implementation "com.blankj:utilcode:1.25.9" implementation "com.blankj:utilcode:1.25.9"
api "com.tencent.liteav:LiteAVSDK_TRTC:latest.release" api "com.tencent.liteav:LiteAVSDK_TRTC:latest.release"
......
...@@ -320,7 +320,7 @@ public class TRTCCalling { ...@@ -320,7 +320,7 @@ public class TRTCCalling {
@Override @Override
public void onReceiveNewInvitation(String inviteID, String inviter, String groupID, public void onReceiveNewInvitation(String inviteID, String inviter, String groupID,
List<String> inviteeList, String data) { List<String> inviteeList, String data) {
TRTCLogger.d(TAG, "onReceiveNewInvitation inviteID:" + inviteID + ", inviter:" + inviter TRTCLogger.e(TAG, "onReceiveNewInvitation inviteID:" + inviteID + ", inviter:" + inviter
+ ", groupID:" + groupID + ", inviteeList:" + inviteeList + " data:" + data); + ", groupID:" + groupID + ", inviteeList:" + inviteeList + " data:" + data);
final UserModel userModel = UserModelManager.getInstance().getUserModel(); final UserModel userModel = UserModelManager.getInstance().getUserModel();
......
...@@ -5,15 +5,13 @@ import android.content.pm.PackageManager; ...@@ -5,15 +5,13 @@ import android.content.pm.PackageManager;
import android.os.Build; import android.os.Build;
import android.widget.Toast; import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import com.ydl.ydlcommon.base.BaseActivity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public abstract class TRTCBaseActivity extends BaseActivity { public abstract class TRTCBaseActivity extends AppCompatActivity {
protected static final int REQ_PERMISSION_CODE = 0x1000; protected static final int REQ_PERMISSION_CODE = 0x1000;
protected int mGrantedCount = 0; protected int mGrantedCount = 0;
......
...@@ -19,7 +19,6 @@ import com.tencent.rtmp.ui.TXCloudVideoView; ...@@ -19,7 +19,6 @@ import com.tencent.rtmp.ui.TXCloudVideoView;
import com.tencent.trtc.TRTCCloud; import com.tencent.trtc.TRTCCloud;
import com.tencent.trtc.TRTCCloudDef; import com.tencent.trtc.TRTCCloudDef;
import com.tencent.trtc.TRTCCloudListener; import com.tencent.trtc.TRTCCloudListener;
import com.yidianling.common.tools.LogUtil;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -65,22 +64,11 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli ...@@ -65,22 +64,11 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
private String mUserId; private String mUserId;
private boolean mAudioRouteFlag = true; private boolean mAudioRouteFlag = true;
@Override
protected void initDataAndEvent() {
handleIntent();
}
@Override
protected int layoutResId() {
return R.layout.videocall_activity_calling;
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
handleIntent();
setContentView(R.layout.videocall_activity_calling);
if (checkPermission()) { if (checkPermission()) {
initView(); initView();
enterRoom(); enterRoom();
...@@ -107,7 +95,7 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli ...@@ -107,7 +95,7 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
btnVideo = findViewById(R.id.btn_video); btnVideo = findViewById(R.id.btn_video);
btnAudio = findViewById(R.id.btn_audio); btnAudio = findViewById(R.id.btn_audio);
btnVideo.setSelected(true); btnVideo.setSelected(true);
btnAudio.setSelected(true); btnAudio.setSelected(false);
ivVideo = findViewById(R.id.iv_video); ivVideo = findViewById(R.id.iv_video);
ivAudio = findViewById(R.id.iv_audio); ivAudio = findViewById(R.id.iv_audio);
tvLeave = findViewById(R.id.tv_leave); tvLeave = findViewById(R.id.tv_leave);
...@@ -161,7 +149,7 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli ...@@ -161,7 +149,7 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
trtcParams.sdkAppId = userModel.appId; trtcParams.sdkAppId = userModel.appId;
trtcParams.userId = mUserId; trtcParams.userId = mUserId;
trtcParams.roomId = Integer.parseInt(mRoomId); trtcParams.roomId = Integer.parseInt(mRoomId);
LogUtil.d("userSig",userModel.userSig); Log.d("userSig",userModel.userSig);
trtcParams.userSig = userModel.userSig; trtcParams.userSig = userModel.userSig;
mTRTCCloud.startLocalPreview(mIsFrontCamera, mTXCVVLocalPreviewView); mTRTCCloud.startLocalPreview(mIsFrontCamera, mTXCVVLocalPreviewView);
...@@ -241,10 +229,10 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli ...@@ -241,10 +229,10 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
boolean isSelected = btnAudio.isSelected(); boolean isSelected = btnAudio.isSelected();
if (!isSelected) { if (!isSelected) {
mTRTCCloud.muteLocalAudio(true); mTRTCCloud.muteLocalAudio(true);
ivAudio.setImageResource(R.drawable.trtccalling_ic_me_audio_open); ivAudio.setImageResource(R.drawable.trtccalling_ic_me_audio_close);
} else { } else {
mTRTCCloud.muteLocalAudio(false); mTRTCCloud.muteLocalAudio(false);
ivAudio.setImageResource(R.drawable.trtccalling_ic_me_audio_close); ivAudio.setImageResource(R.drawable.trtccalling_ic_me_audio_open);
} }
btnAudio.setSelected(!isSelected); btnAudio.setSelected(!isSelected);
} }
......
...@@ -48,22 +48,12 @@ public class YDLInvitionActivity extends TRTCBaseActivity { ...@@ -48,22 +48,12 @@ public class YDLInvitionActivity extends TRTCBaseActivity {
} }
@Override @Override
protected void initDataAndEvent() {
handleIntent();
}
@Override
protected int layoutResId() {
return R.layout.video_invition_activity;
}
@Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (checkPermission()) { handleIntent();
setContentView(R.layout.video_invition_activity);
initView(); initView();
} }
}
private void handleIntent() { private void handleIntent() {
Intent intent = getIntent(); Intent intent = getIntent();
...@@ -107,15 +97,12 @@ public class YDLInvitionActivity extends TRTCBaseActivity { ...@@ -107,15 +97,12 @@ public class YDLInvitionActivity extends TRTCBaseActivity {
mIvVideoInviteRefuse = findViewById(R.id.iv_video_invite_refuse); mIvVideoInviteRefuse = findViewById(R.id.iv_video_invite_refuse);
//接听 //接听
mIvVideoInviteAccept.setOnClickListener(new View.OnClickListener() { mIvVideoInviteAccept.setOnClickListener(v -> {
@Override
public void onClick(View v) {
Intent intent = new Intent(YDLInvitionActivity.this, VideoCallingActivity.class); Intent intent = new Intent(YDLInvitionActivity.this, VideoCallingActivity.class);
intent.putExtra(Constant.ROOM_ID, mRoomId); intent.putExtra(Constant.ROOM_ID, mRoomId);
intent.putExtra(Constant.USER_ID, mUserId); intent.putExtra(Constant.USER_ID, mUserId);
startActivity(intent); startActivity(intent);
finish(); finish();
}
}); });
//拒绝 //拒绝
mIvVideoInviteRefuse.setOnClickListener(new View.OnClickListener() { mIvVideoInviteRefuse.setOnClickListener(new View.OnClickListener() {
......
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