|
@@ -96,7 +96,7 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
private boolean initData() {
|
|
|
if (Macros.DEBUG_AGORA) {
|
|
|
mVideoType = Constant.VIDEO_TYPE_AGORA;
|
|
|
- mCallType = Constant.VIDEO_CALL_OUT;
|
|
|
+ mCallType = Constant.VIDEO_CALL_IN;
|
|
|
mCallId = "3523b1d1-8543-43d9-92c9-df663a3f147d";
|
|
|
mCallChannelName = "83a514e0-ecfe-4d99-9c96-b586594ebe1a_TK_QjZ0vC1tBa_1745474154670";
|
|
|
mCallToken = "007eJxSYCicFXvbucygd07L25c+L4pjJnRqlf+Pa79yxmtneLVq3yEFBkujZBNjU4skyzRLCxNDyzTLREODFGMT01RTy0Rz8zTDrEucGQqmDAwXCq4wMDIwMrAwMDKA+ExgkhlMsoBJBwYL40RTQ5NUA93U5LRUXZMUS0tdy2RLM90kUwszU0uT1KRUw8T4EO/4wKwogzJnwxKnxHhDcxNTE3MTQ1MTM3MDRgYDQAAAAP//yx0xFw==";
|
|
@@ -163,24 +163,6 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void initVideoManager() {
|
|
|
- Log.d(TAG, "initVideoManager: ");
|
|
|
- String userId = DataManager.getWatchTicket(this);
|
|
|
- if (mVideoType == Constant.VIDEO_TYPE_JUPHOON) {
|
|
|
- mJuphoonManager.init(this, userId);
|
|
|
- } else {
|
|
|
- mAgoraManager.init(this, userId);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- protected void refreshInfo() {
|
|
|
- Log.d(TAG, "refreshInfo: ");
|
|
|
- //ToolsUtils.setImageView(mIconView, mContactBean.profilePath, 0, R.drawable.default_avatar);
|
|
|
- mNameText.setText(mContactBean.name);
|
|
|
- mHintText.setText(mCallType == Constant.VIDEO_CALL_OUT ? R.string.calling : R.string.invite);
|
|
|
- refreshView(mCallType);
|
|
|
- }
|
|
|
-
|
|
|
private void refreshView(int step) {
|
|
|
Log.d(TAG, "refreshView: " + step);
|
|
|
if (step == 1) { //呼出
|
|
@@ -226,6 +208,32 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ protected void refreshInfo() {
|
|
|
+ Log.d(TAG, "refreshInfo: ");
|
|
|
+ //ToolsUtils.setImageView(mIconView, mContactBean.profilePath, 0, R.drawable.default_avatar);
|
|
|
+ mNameText.setText(mContactBean.name);
|
|
|
+ mHintText.setText(mCallType == Constant.VIDEO_CALL_OUT ? R.string.calling : R.string.invite);
|
|
|
+ refreshView(mCallType);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void initVideoManager() {
|
|
|
+ Log.d(TAG, "initVideoManager: ");
|
|
|
+ String userId = DataManager.getWatchTicket(this);
|
|
|
+ if (mVideoType == Constant.VIDEO_TYPE_JUPHOON) {
|
|
|
+ mJuphoonManager.init(this, userId);
|
|
|
+ } else {
|
|
|
+ mAgoraManager.init(this, userId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onInitOK() {
|
|
|
+ Log.d(TAG, "onInitOK: ");
|
|
|
+ if (mVideoType == Constant.VIDEO_TYPE_AGORA) {
|
|
|
+ mAgoraManager.initLocalCanvas(this, mVideoLayout, mVideoLayoutView);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void onLoginOK() {
|
|
|
Log.d(TAG, "onLoginOK: ");
|
|
@@ -233,9 +241,13 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
if (mVideoType == Constant.VIDEO_TYPE_JUPHOON) {
|
|
|
mJuphoonManager.call(mCallId);
|
|
|
} else {
|
|
|
- mAgoraManager.initLocalCanvas(this, mVideoLayout, mVideoLayoutView);
|
|
|
+ onPendingBegin();
|
|
|
mAgoraManager.joinChannel(mCallToken, mCallChannelName);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if (mVideoType == Constant.VIDEO_TYPE_AGORA) {
|
|
|
+ onPendingBegin();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -255,7 +267,7 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void onEnterRoom() {
|
|
|
+ public void onPendingBegin() {
|
|
|
if (mCallType == Constant.VIDEO_CALL_OUT) {
|
|
|
refreshView(1);
|
|
|
} else {
|
|
@@ -266,16 +278,21 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
if (mMediaPlayerUtils != null) {
|
|
|
mMediaPlayerUtils.playSound(this, R.raw.video_call, true);
|
|
|
}
|
|
|
+ startTimeoutTimer();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void onPending(SurfaceView view) {
|
|
|
- Log.d(TAG, "onPending: ");
|
|
|
- startTimeoutTimer();
|
|
|
+ public void onPendingLocalCanvas(SurfaceView view) {
|
|
|
+ Log.d(TAG, "onPendingLocalCanvas: ");
|
|
|
if (mVideoType == Constant.VIDEO_TYPE_JUPHOON) {
|
|
|
mVideoLayout.addView(view, 0);
|
|
|
+ refreshView(10);
|
|
|
+ } else {
|
|
|
+ refreshView(mCallType == Constant.VIDEO_CALL_OUT ? 10 : 11);
|
|
|
+// mVideoLayout.setVisibility(View.VISIBLE);
|
|
|
+// mBottomInLayout.setVisibility(View.GONE);
|
|
|
+// mBottomIngLayout.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
- refreshView(10);
|
|
|
}
|
|
|
|
|
|
@Override
|