Skip to content

Commit

Permalink
Merge branch 'netease-kit:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerjin93 authored Sep 2, 2024
2 parents bdd500e + df88e79 commit c29cac6
Show file tree
Hide file tree
Showing 163 changed files with 58,289 additions and 4,630 deletions.
3 changes: 2 additions & 1 deletion SampleCode/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
NEMeetingSDK/
NEMeetingSDK/
/Windows_macOS/meeting_sdk_example_qt/meeting_sdk_example_qt/
6 changes: 3 additions & 3 deletions SampleCode/Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.netease.yunxin.kit.meeting.sampleapp"
minSdkVersion 21
targetSdkVersion 34
versionCode 40600
versionName "4.6.0"
versionCode 40700
versionName "4.7.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -65,7 +65,7 @@ dependencies {
implementation "androidx.navigation:navigation-ui-ktx:2.3.0"
implementation 'com.manu:MDatePicker:1.0.1'

implementation("com.netease.yunxin.kit.meeting:meeting:4.6.0")
implementation("com.netease.yunxin.kit.meeting:meeting:4.7.0")

compileOnly 'com.netease.yunxin:nertc-full:5.5.40'
compileOnly 'com.netease.nimlib:basesdk:9.16.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import com.netease.yunxin.kit.meeting.sdk.menu.NEMenuStateController;
import com.netease.yunxin.kit.meeting.sdk.menu.NEMenuVisibility;
import com.netease.yunxin.kit.meeting.sdk.menu.NESingleStateMenuItem;
import java.lang.reflect.Method;

public class MainActivity extends BaseActivity<ActivityMainBinding> {

Expand Down Expand Up @@ -257,17 +256,6 @@ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
case R.id.im_login:
NIMLoginActivity.start(this);
break;
case R.id.open_flutter_page:
try {
Class<?> clz =
Class.forName("com.example.flutter_module_library.FlutterContainerActivity");
Method startCached = clz.getDeclaredMethod("startCached", Context.class);
startCached.setAccessible(true);
startCached.invoke(null, this);
} catch (Throwable e) {
e.printStackTrace();
}
break;
case R.id.minimize_meeting:
minimizeCurrentMeeting();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public void loginWithSDKToken(final String accountId, final String accountToken)
accountToken,
new ToastCallback<Void>(context, "登录") {
@Override
public void onResult(int resultCode, String resultMsg, Void resultData) {
super.onResult(resultCode, resultMsg, resultData);
public void onResult(int resultCode, String resultMessage, Void resultData) {
super.onResult(resultCode, resultMessage, resultData);
onLoginResult(resultCode, null, null);
}
});
Expand All @@ -128,9 +128,9 @@ public void logout(boolean manual) {
.logout(
new ToastCallback<Void>(context, "注销") {
@Override
public void onResult(int resultCode, String resultMsg, Void resultData) {
public void onResult(int resultCode, String resultMessage, Void resultData) {
//手动退出登录才进行toast提示
if (manual) super.onResult(resultCode, resultMsg, resultData);
if (manual) super.onResult(resultCode, resultMessage, resultData);
if (resultCode == NEMeetingError.ERROR_CODE_SUCCESS) {
if (state.compareAndSet(AUTHORIZED, UN_AUTHORIZE)) {
SPUtils.getInstance().remove(KEY_ACCOUNT);
Expand All @@ -152,8 +152,8 @@ private void handleResponse(String account, String pwd, Response<SDKAuthInfo> re
result.data.token,
new ToastCallback<Void>(context, "登录") {
@Override
public void onResult(int resultCode, String resultMsg, Void resultData) {
super.onResult(resultCode, resultMsg, resultData);
public void onResult(int resultCode, String resultMessage, Void resultData) {
super.onResult(resultCode, resultMessage, resultData);
onLoginResult(
resultCode,
() -> SPUtils.getInstance().put(KEY_ACCOUNT, account).put(KEY_PWD, pwd),
Expand All @@ -178,8 +178,8 @@ private void handleLoginWithNEMeeting(String account, String pwd) {
pwd,
new ToastCallback<Void>(context, "登录") {
@Override
public void onResult(int resultCode, String resultMsg, Void resultData) {
super.onResult(resultCode, resultMsg, resultData);
public void onResult(int resultCode, String resultMessage, Void resultData) {
super.onResult(resultCode, resultMessage, resultData);
onLoginResult(
resultCode,
() -> SPUtils.getInstance().put(KEY_ACCOUNT, account).put(KEY_PWD, pwd),
Expand All @@ -194,8 +194,8 @@ private void tryAutoLogin() {
.tryAutoLogin(
new ToastCallback<Void>(context, "自动登录") {
@Override
public void onResult(int resultCode, String resultMsg, Void resultData) {
super.onResult(resultCode, resultMsg, resultData);
public void onResult(int resultCode, String resultMessage, Void resultData) {
super.onResult(resultCode, resultMessage, resultData);
onLoginResult(resultCode, null, null);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import androidx.annotation.NonNull;
import com.netease.yunxin.kit.meeting.sampleapp.data.ServerConfig;
import com.netease.yunxin.kit.meeting.sampleapp.utils.SPUtils;
import com.netease.yunxin.kit.meeting.sdk.NEMeetingCorpInfo;
import com.netease.yunxin.kit.meeting.sdk.NEMeetingError;
import com.netease.yunxin.kit.meeting.sdk.NEMeetingKit;
import com.netease.yunxin.kit.meeting.sdk.NEMeetingKitConfig;
Expand Down Expand Up @@ -71,19 +72,6 @@ public void removeListener(InitializeListener listener) {
}
}

public int getLoggerLevelConfig() {
int level = 0;
try {
level = Integer.parseInt(SPUtils.getInstance().getString("meeting-logger-level-config"));
} catch (NumberFormatException ignored) {
}
return level;
}

public String getLoggerPathConfig() {
return SPUtils.getInstance().getString("meeting-logger-path-config");
}

private void listenLanguageSettingChange() {
SPUtils.getInstance()
.registerOnSharedPreferenceChangeListener(
Expand Down Expand Up @@ -119,13 +107,14 @@ private void initializeSdk() {
config.serverUrl = serverConfig.getServerUrl();
config.useAssetServerConfig = serverConfig.getUseAssetServerConfig();
NEMeetingKit.getInstance()
.initialize(
.initializeEx(
context,
config,
new ToastCallback<Void>(context, "初始化") {
new ToastCallback<NEMeetingCorpInfo>(context, "初始化") {
@Override
public void onResult(int resultCode, String resultMsg, Void resultData) {
super.onResult(resultCode, resultMsg, resultData);
public void onResult(
int resultCode, String resultMessage, NEMeetingCorpInfo resultData) {
super.onResult(resultCode, resultMessage, resultData);
if (resultCode == NEMeetingError.ERROR_CODE_SUCCESS) {
notifyInitialized();
unregisterNetworkCallback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public ToastCallback(Context context, String prefix) {
}

@Override
public void onResult(int resultCode, String resultMsg, T resultData) {
LogUtil.log(TAG, prefix + " onResult: " + resultCode + '|' + resultMsg + '|' + resultData);
public void onResult(int resultCode, String resultMessage, T resultData) {
LogUtil.log(TAG, prefix + " onResult: " + resultCode + '|' + resultMessage + '|' + resultData);
Toast.makeText(
context,
prefix
+ (resultCode == NEMeetingError.ERROR_CODE_SUCCESS
? "成功"
: "失败" + (resultMsg != null ? ": " + resultMsg : "")),
: "失败" + (resultMessage != null ? ": " + resultMessage : "")),
Toast.LENGTH_SHORT)
.show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.netease.yunxin.kit.meeting.sdk.*;

import com.netease.yunxin.kit.meeting.ui.NEFeedbackActivity;
import java.util.List;

public class MeetingDataRepository {
Expand Down Expand Up @@ -174,6 +174,12 @@ public void setBeautyFaceValue(int beautyFaceValue) {
// NEMeetingKit.getInstance().getSettingsService().setBeautyFaceValue(beautyFaceValue);
}

public void loadFeedbackView(Context context, NECallback<Void> callback) {
NEMeetingKit.getInstance()
.getFeedbackService()
.loadFeedbackView(context, NEFeedbackActivity.class, callback);
}

public void startScreenSharing(
Context context,
Intent data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,20 @@ private static String[] getMenuItemTitle(NEMeetingMenuItem item) {
return new String[] {"聊天"};
case NEMenuIDs.NOTIFY_CENTER_MENU_ID:
return new String[] {"通知"};
case NEMenuIDs.WHITEBOARD_ID:
case NEMenuIDs.SIP_CALL_MENU_ID:
return new String[] {"呼叫"};
case NEMenuIDs.SETTINGS_MENU_ID:
return new String[] {"设置"};
case NEMenuIDs.WHITEBOARD_MENU_ID:
return new String[] {"共享白板", "退出白板"};
case NEMenuIDs.CLOUD_RECORD_ID:
case NEMenuIDs.CLOUD_RECORD_MENU_ID:
return new String[] {"云录制", "结束录制"};
case NEMenuIDs.SECURITY_ID:
case NEMenuIDs.SECURITY_MENU_ID:
return new String[] {"安全"};
case NEMenuIDs.DISCONNECT_AUDIO_ID:
case NEMenuIDs.DISCONNECT_AUDIO_MENU_ID:
return new String[] {"断开音频", "连接音频"};
case NEMenuIDs.FEEDBACK_MENU_ID:
return new String[] {"问题反馈"};
}

if (item instanceof NESingleStateMenuItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static Date strToDateLong(String strDate) {
* @param dateDate
* @return
*/
public static String dateToStrLong(java.util.Date dateDate) {
public static String dateToStrLong(Date dateDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(dateDate);
return dateString;
Expand All @@ -189,7 +189,7 @@ public static String dateToStrLong(java.util.Date dateDate) {
* @param dateDate
* @return
*/
public static String dateToStr(java.util.Date dateDate) {
public static String dateToStr(Date dateDate) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String dateString = formatter.format(dateDate);
return dateString;
Expand Down Expand Up @@ -310,8 +310,8 @@ public static String getTwoDay(String sj1, String sj2) {
SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
long day = 0;
try {
java.util.Date date = myFormatter.parse(sj1);
java.util.Date mydate = myFormatter.parse(sj2);
Date date = myFormatter.parse(sj1);
Date mydate = myFormatter.parse(sj2);
day = (date.getTime() - mydate.getTime()) / (24 * 60 * 60 * 1000);
} catch (Exception e) {
return "";
Expand Down Expand Up @@ -523,8 +523,8 @@ public static long getDays(String date1, String date2) {
if (date2 == null || date2.equals("")) return 0;
// 转换为标准时间
SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
java.util.Date date = null;
java.util.Date mydate = null;
Date date = null;
Date mydate = null;
try {
date = myFormatter.parse(date1);
mydate = myFormatter.parse(date2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ protected void performAction(
new NEWatermarkConfig(SdkAuthenticator.getAccount(displayName), null, null, null);
NEJoinMeetingOptions options =
(NEJoinMeetingOptions) getMeetingOptions(new NEJoinMeetingOptions());
options.enableAudioDeviceSwitch = binding.enableAudioDeviceSwitch.isChecked();
showDialogProgress("正在加入会议...");
if (isAnonymous()) {
mViewModel.anonymousJoinMeeting(params, options, new MeetingCallback());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.netease.yunxin.kit.meeting.sampleapp.menu.InjectMenuArrangeActivity;
import com.netease.yunxin.kit.meeting.sampleapp.menu.InjectMenuContainer;
import com.netease.yunxin.kit.meeting.sampleapp.utils.AlertDialogUtil;
import com.netease.yunxin.kit.meeting.sdk.NECloudRecordConfig;
import com.netease.yunxin.kit.meeting.sdk.NELocalHistoryMeeting;
import com.netease.yunxin.kit.meeting.sdk.NEMeetingChatroomConfig;
import com.netease.yunxin.kit.meeting.sdk.NEMeetingCode;
Expand Down Expand Up @@ -158,11 +159,16 @@ public NEMeetingOptions getMeetingOptions(NEMeetingOptions options) {
options.noVideo = !binding.videoOption.isChecked();
options.noAudio = !binding.audioOption.isChecked();
options.showMeetingTime = binding.showMeetingTime.isChecked();
options.enableFrontCameraMirror = binding.enableFrontCameraMirror.isChecked();
options.enableTransparentWhiteboard = binding.enableTransparentWhiteboard.isChecked();
} else {
NESettingsService settingsService = NEMeetingKit.getInstance().getSettingsService();
options.noVideo = !settingsService.isTurnOnMyVideoWhenJoinMeetingEnabled();
options.noAudio = !settingsService.isTurnOnMyAudioWhenJoinMeetingEnabled();
options.showMeetingTime = settingsService.isShowMyMeetingElapseTimeEnabled();
options.enableSpeakerSpotlight = settingsService.isSpeakerSpotlightEnabled();
options.enableFrontCameraMirror = settingsService.isFrontCameraMirrorEnabled();
options.enableTransparentWhiteboard = settingsService.isTransparentWhiteboardEnabled();
}
options.joinTimeout = MeetingConfigRepository.INSTANCE.getJoinTimeout();

Expand All @@ -181,7 +187,6 @@ public NEMeetingOptions getMeetingOptions(NEMeetingOptions options) {
options.meetingIdDisplayOption = getMeetingIdDisplayOption();
options.noGallery = binding.noGalleryOptions.isChecked();
options.noSwitchCamera = binding.noSwitchCamera.isChecked();
options.enableFrontCameraMirror = binding.enableFrontCameraMirror.isChecked();
options.noSwitchAudioMode = binding.noSwitchAudioMode.isChecked();
options.noWhiteBoard = binding.noWhiteBoard.isChecked();
options.noSip = binding.noSip.isChecked();
Expand All @@ -204,7 +209,10 @@ public NEMeetingOptions getMeetingOptions(NEMeetingOptions options) {
}
// 如果是创建会议判断是否需要录制
if (options instanceof NEStartMeetingOptions) {
((NEStartMeetingOptions) options).noCloudRecord = !binding.cloudRecord.isChecked();
// ((NEStartMeetingOptions) options).noCloudRecord = !binding.cloudRecord.isChecked();
((NEStartMeetingOptions) options).cloudRecordConfig = new NECloudRecordConfig();
((NEStartMeetingOptions) options)
.cloudRecordConfig.setEnable(binding.cloudRecord.isChecked());
}
options.fullToolbarMenuItems = toolbarMenu;
options.fullMoreMenuItems = moreMenu;
Expand All @@ -215,7 +223,6 @@ public NEMeetingOptions getMeetingOptions(NEMeetingOptions options) {
options.showScreenShareUserVideo = binding.showScreenShareUserVideo.isChecked();
options.showWhiteboardShareUserVideo = binding.showWhiteboardShareUserVideo.isChecked();
options.showFloatingMicrophone = binding.showFloatingMicrophone.isChecked();
options.enableTransparentWhiteboard = binding.enableTransparentWhiteboard.isChecked();
options.enableAudioShare = binding.enableAudioShare.isChecked();
options.showCloudRecordingUI = binding.showCloudRecordingUI.isChecked();
options.showCloudRecordMenuItem = binding.showCloudRecordMenuItem.isChecked();
Expand Down Expand Up @@ -252,19 +259,19 @@ public MeetingCallback() {
}

@Override
public void onResult(int resultCode, String resultMsg, Void resultData) {
public void onResult(int resultCode, String resultMessage, Void resultData) {
if (isAdded()) dissMissDialogProgress();
if (resultCode == NEMeetingError.ERROR_CODE_NO_AUTH) {
Toast.makeText(context, "当前账号已在其他设备上登录", Toast.LENGTH_SHORT).show();
SdkAuthenticator.getInstance().logout(false);
} else if (resultCode == NEMeetingError.ERROR_CODE_FAILED) {
Toast.makeText(context, resultMsg, Toast.LENGTH_SHORT).show();
Toast.makeText(context, resultMessage, Toast.LENGTH_SHORT).show();
dissMissDialogProgress();
} else if (resultCode == NEMeetingError.ERROR_CODE_MEETING_ALREADY_EXIST) {
Toast.makeText(context, "会议创建失败,该会议还在进行中", Toast.LENGTH_SHORT).show();
dissMissDialogProgress();
} else if (resultCode != NEMeetingError.ERROR_CODE_SUCCESS) {
super.onResult(resultCode, resultMsg, resultData);
super.onResult(resultCode, resultMessage, resultData);
}
}
}
Expand All @@ -290,10 +297,10 @@ public void onResult(int resultCode, String resultMsg, Void resultData) {
.postDelayed(
() -> {
NEMeetingKit.getInstance()
.getSettingsService()
.getHistoryMeetingItem(
.getPreMeetingService()
.getLocalHistoryMeetingList(
(resultCode, resultMsg, resultData) -> {
if (resultData != null && resultData.size() > 0) {
if (resultData != null && !resultData.isEmpty()) {
NELocalHistoryMeeting history = resultData.get(0);
Log.d("MeetingCommonFragment", "getHistoryMeetingItem: " + history);
if (history
Expand Down
Loading

0 comments on commit c29cac6

Please sign in to comment.