Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to version3.6.9 #392

Merged
merged 4 commits into from
Jun 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/java/com/hyphenate/chatuidemo/Constant.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class Constant extends EaseConstant{
public static final String EXTRA_CONFERENCE_ID = "confId";
public static final String EXTRA_CONFERENCE_PASS = "password";
public static final String EXTRA_CONFERENCE_INVITER = "inviter";
public static final String EXTRA_CONFERENCE_IS_CREATOR = "is_creator";
public static final String EXTRA_CONFERENCE_IS_CREATOR= "is_creator";
public static final String EXTRA_CONFERENCE_GROUP_ID = "group_id";

public static final String MSG_ATTR_CONF_ID = "conferenceId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
Expand Down Expand Up @@ -37,6 +38,7 @@
import com.hyphenate.chat.EMConferenceStream;
import com.hyphenate.chat.EMConversation;
import com.hyphenate.chat.EMMessage;
import com.hyphenate.chat.EMMirror;
import com.hyphenate.chat.EMStreamParam;
import com.hyphenate.chat.EMStreamStatistics;
import com.hyphenate.chat.EMWaterMarkOption;
Expand Down Expand Up @@ -814,6 +816,20 @@ public void onSuccess(Object value) {
ExternalAudioInputRecord.getInstance().stopRecording();
}
finish();

//start MainActivity
if(DemoApplication.getInstance().getLifecycleCallbacks().isFront()){
Activity activity = DemoApplication.getInstance().getLifecycleCallbacks().getActivityList().get(0);
if(activity instanceof ConferenceActivity){
EMLog.i(TAG, "ConferenceActivity exit: " + "start MainActivity by ConferenceActivity");
activity = DemoApplication.getInstance().getLifecycleCallbacks().getActivityList().get(1);
startActivity(new Intent(ConferenceActivity.this, activity.getClass()));

}else{
EMLog.i(TAG, "ConferenceActivity exit: " + "start MainActivity by DemoApplication.applicationContext");
startActivity(new Intent(DemoApplication.applicationContext, activity.getClass()));
}
}
}
@Override
public void onError(int error, String errorMsg) {
Expand Down Expand Up @@ -841,6 +857,10 @@ private void publish() {
if(PreferenceManager.getInstance().isWatermarkResolution()){
//推流时设置水印图片
EMClient.getInstance().conferenceManager().setWaterMark(watermark);
//设置水印时取消本地镜像显示
EMClient.getInstance().conferenceManager().setLocalVideoViewMirror(EMMirror.OFF);
}else{
EMClient.getInstance().conferenceManager().setLocalVideoViewMirror(EMMirror.ON);
}
EMClient.getInstance().conferenceManager().publish(normalParam, new EMValueCallBack<String>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,5 +376,4 @@ private List<String> getPermissionsListToRequest(@NonNull Activity activity,
}
return permList;
}

}
14 changes: 9 additions & 5 deletions app/src/main/java/com/hyphenate/chatuidemo/ui/CallActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.hyphenate.chat.EMConversation;
import com.hyphenate.chat.EMMessage;
import com.hyphenate.chat.EMMessage.Status;
import com.hyphenate.chat.EMMirror;
import com.hyphenate.chat.EMTextMessageBody;
import com.hyphenate.chat.EMWaterMarkOption;
import com.hyphenate.chatuidemo.Constant;
Expand Down Expand Up @@ -61,7 +62,6 @@ public class CallActivity extends BaseActivity {

private Bitmap watermarkbitmap;
private EMWaterMarkOption watermark;
private EMWaterMarkOption wmOption;

/**
* 0:voice call,1:video call
Expand Down Expand Up @@ -125,8 +125,7 @@ public void onProgress(int progress, String status) {
} catch (Exception e) {
e.printStackTrace();
}
wmOption = new EMWaterMarkOption(watermarkbitmap, 75, 25, EMWaterMarkPosition.TOP_RIGHT, 8, 8);
// watermark = new EMWaterMarkOption(watermarkbitmap, 75, 25, EMWaterMarkPosition.TOP_RIGHT, 8, 8);
watermark = new EMWaterMarkOption(watermarkbitmap, 75, 25, EMWaterMarkPosition.TOP_RIGHT, 8, 8);
}

}
Expand Down Expand Up @@ -184,8 +183,13 @@ boolean record = PreferenceManager.getInstance().isRecordOnServer();
if (msg.what == MSG_CALL_MAKE_VIDEO) {
//推流时设置水印图片
if(PreferenceManager.getInstance().isWatermarkResolution()){
EMClient.getInstance().callManager().setWaterMark(wmOption);
// EMClient.getInstance().callManager().setWaterMark(wmOption);
EMClient.getInstance().callManager().setWaterMark(watermark);
//开启水印时候本地不开启镜像显示
EMClient.getInstance().callManager().getCallOptions().
setLocalVideoViewMirror(EMMirror.OFF);
}else{
EMClient.getInstance().callManager().getCallOptions().
setLocalVideoViewMirror(EMMirror.ON);
}
EMClient.getInstance().callManager().makeVideoCall(username, "", record, merge);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onActivityStopped(Activity activity) {
Log.e("ActivityLifecycle", "onActivityStopped "+activity.getLocalClassName());
resumeActivity.remove(activity);
if(resumeActivity.isEmpty()) {
Log.e("TAG", "在后台了");
Log.e("ActivityLifecycle", "在后台了");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是在改动什么?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前调试问题都时候改过一下

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.hyphenate.chat.EMCallSession;
import com.hyphenate.chat.EMCallStateChangeListener;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMMirror;
import com.hyphenate.chat.EMVideoCallHelper;
import com.hyphenate.chatuidemo.DemoHelper;
import com.hyphenate.chatuidemo.R;
Expand Down Expand Up @@ -257,12 +258,22 @@ public void run() {
case ACCEPTED: // call is accepted
surfaceState = 0;
handler.removeCallbacks(timeoutHangup);


//推流时设置水印图片
if(PreferenceManager.getInstance().isWatermarkResolution()){
EMClient.getInstance().callManager().setWaterMark(watermark);
String callId = EMClient.getInstance().callManager().getCurrentCallSession().getCallId();

if(!EMClient.getInstance().callManager().getCurrentCallSession().getIscaller()){
//推流时设置水印图片
if(PreferenceManager.getInstance().isWatermarkResolution()){
EMClient.getInstance().callManager().setWaterMark(watermark);

//开启水印时候本地不开启镜像显示
EMClient.getInstance().callManager().getCallOptions().
setLocalVideoViewMirror(EMMirror.OFF);
}else{
EMClient.getInstance().callManager().getCallOptions().
setLocalVideoViewMirror(EMMirror.ON);
}
}

runOnUiThread(new Runnable() {

@Override
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/em_activity_call_option.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@
android:layout_height="wrap_content"
android:text="back camera"
android:layout_gravity="center"/>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没修过的尽量不要提交

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经还原

<Spinner
android:id="@+id/spinner_video_resolution_back"
android:layout_width="match_parent"
Expand Down