|
@@ -137,13 +137,13 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
refreshInfoLayout(0);
|
|
|
});
|
|
|
cancelInBtn.setOnClickListener(v -> {
|
|
|
- videoEndStep1();
|
|
|
+ onMyExitRoom();
|
|
|
});
|
|
|
cancelOutBtn.setOnClickListener(v -> {
|
|
|
- videoEndStep1();
|
|
|
+ onMyExitRoom();
|
|
|
});
|
|
|
cancelIngBtn.setOnClickListener(v -> {
|
|
|
- videoEndStep1();
|
|
|
+ onMyExitRoom();
|
|
|
});
|
|
|
answerInBtn.setOnClickListener(v -> {
|
|
|
videoAnswer();
|
|
@@ -315,6 +315,15 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ private void onMyExitRoom() {
|
|
|
+ if (mVideoType == SKConstant.VIDEO_TYPE_JUPHOON) {
|
|
|
+ mJuphoonManager.hangup();
|
|
|
+ } else {
|
|
|
+ mAgoraManager.hangup();
|
|
|
+ }
|
|
|
+ videoEndStep1();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void onRemoteExitRoom() {
|
|
|
Log.d(TAG, "onRemoteExitRoom: ");
|
|
@@ -401,11 +410,7 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
|
|
|
private void onTimeoutTimerCallback() {
|
|
|
showToast(getString(R.string.timeout));
|
|
|
- if (mVideoType == SKConstant.VIDEO_TYPE_JUPHOON) {
|
|
|
- mJuphoonManager.hangup();
|
|
|
- } else {
|
|
|
- mAgoraManager.hangup();
|
|
|
- }
|
|
|
+ onMyExitRoom();
|
|
|
}
|
|
|
|
|
|
@SuppressLint("DefaultLocale")
|
|
@@ -428,27 +433,12 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void showToast(String content) {
|
|
|
- Toast t = Toast.makeText(getApplicationContext(), content, Toast.LENGTH_SHORT);
|
|
|
- t.show();
|
|
|
- }
|
|
|
-
|
|
|
private void videoEndStep1() {
|
|
|
- if (mVideoType == SKConstant.VIDEO_TYPE_JUPHOON) {
|
|
|
- mJuphoonManager.clear();
|
|
|
- mJuphoonManager = null;
|
|
|
- } else {
|
|
|
- mAgoraManager.clear();
|
|
|
- mAgoraManager = null;
|
|
|
- }
|
|
|
-
|
|
|
- stopTimeoutTimer();
|
|
|
- stopTalkingTimer();
|
|
|
-
|
|
|
if (mMediaPlayerUtils != null) {
|
|
|
mMediaPlayerUtils.stopSound();
|
|
|
}
|
|
|
-
|
|
|
+ stopTimeoutTimer();
|
|
|
+ stopTalkingTimer();
|
|
|
refreshView(20);
|
|
|
new Handler().postDelayed(new Runnable() {
|
|
|
@Override
|
|
@@ -462,9 +452,21 @@ public class MainActivity extends BaseActionActivity implements Listener.VideoLi
|
|
|
if (mMediaPlayerUtils != null) {
|
|
|
mMediaPlayerUtils.playSound(this, R.raw.video_cancel, false);
|
|
|
}
|
|
|
+ if (mVideoType == SKConstant.VIDEO_TYPE_JUPHOON) {
|
|
|
+ mJuphoonManager.clear();
|
|
|
+ mJuphoonManager = null;
|
|
|
+ } else if (mVideoType == SKConstant.VIDEO_TYPE_AGORA) {
|
|
|
+ mAgoraManager.clear();
|
|
|
+ mAgoraManager = null;
|
|
|
+ }
|
|
|
finish();
|
|
|
}
|
|
|
|
|
|
+ private void showToast(String content) {
|
|
|
+ Toast t = Toast.makeText(getApplicationContext(), content, Toast.LENGTH_SHORT);
|
|
|
+ t.show();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
|
Log.d(TAG, "onDestroy: ");
|