Skip to content

Commit

Permalink
Merge pull request #32 from Luc-netease/master
Browse files Browse the repository at this point in the history
升级呼叫组件 2.2.0
  • Loading branch information
Luc-netease authored Nov 6, 2023
2 parents da1c007 + fdcb988 commit 6cea863
Show file tree
Hide file tree
Showing 113 changed files with 3,075 additions and 1,826 deletions.
2 changes: 2 additions & 0 deletions NLiteAVDemo-Android-Java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,7 @@ dependencies {
implementation(libs.okhttpLoggingInterceptor)
implementation(libs.retrofitCore)
implementation(libs.retrofitConverterGson)
implementation(libs.nertc.nenn)
implementation(libs.nertc.segment)
implementation project(':call-ui')
}
6 changes: 6 additions & 0 deletions NLiteAVDemo-Android-Java/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar"/>

<activity
android:name=".TestActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />

<!-- 云信后台服务,请使用独立进程。 -->
<service
android:name="com.netease.nimlib.service.NimService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.netease.yunxin.app.videocall.nertc.ui.NERTCSelectCallUserActivity;
import com.netease.yunxin.nertc.ui.CallKitUI;
import com.netease.yunxin.nertc.ui.CallKitUIOptions;
import com.netease.yunxin.nertc.ui.p2p.P2PCallActivity;

public class MainActivity extends AppCompatActivity {

Expand Down Expand Up @@ -69,8 +68,8 @@ private void initG2() {
// 设置用户信息
.userInfoHelper(new SelfUserInfoHelper())
// 自定义通话页面
.p2pAudioActivity(P2PCallActivity.class)
.p2pVideoActivity(P2PCallActivity.class)
.p2pAudioActivity(TestActivity.class)
.p2pVideoActivity(TestActivity.class)
.build();
// 若重复初始化会销毁之前的初始化实例,重新初始化
CallKitUI.init(getApplicationContext(), options);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.netease.yunxin.app.videocall;

import android.content.Context;
import android.widget.ImageView;

import androidx.annotation.NonNull;

import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.RequestCallbackWrapper;
Expand All @@ -18,6 +19,7 @@

import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;

class SelfUserInfoHelper implements UserInfoHelper {
@Override
Expand All @@ -41,12 +43,7 @@ public void onResult(int code, List<NimUserInfo> result, Throwable exception) {
}

@Override
public boolean fetchNicknameByTeam(@NotNull String s, @NotNull String s1, @NotNull Function1<? super String, Unit> function1) {
return false;
}

@Override
public boolean loadAvatar(@NotNull Context context, @NotNull String s, @NotNull ImageView imageView) {
public boolean fetchAvatar(@NonNull Context context, @NonNull String accId, @NonNull Function2<? super String, ? super Integer, Unit> notify) {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

package com.netease.yunxin.app.videocall;

import androidx.annotation.NonNull;

import com.netease.yunxin.nertc.ui.base.CallParam;
import com.netease.yunxin.nertc.ui.p2p.P2PCallFragmentActivity;
import com.netease.yunxin.nertc.ui.p2p.P2PUIConfig;

public class TestActivity extends P2PCallFragmentActivity {

@NonNull
@Override
protected P2PUIConfig provideUIConfig(CallParam param) {
return new P2PUIConfig.Builder()
.enableVirtualBlur(true)
.enableFloatingWindow(true)
.enableVirtualBlur(true)
.enableForegroundService(true)
.build();
}
}
10 changes: 9 additions & 1 deletion NLiteAVDemo-Android-Java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ext {
AppKey = ''
BaseUrl = ''
libs = new Libs()
libs.nertc = new Libs.Nertc()
}

class Libs{
Expand All @@ -60,9 +61,16 @@ class Libs{
static def alog = "com.netease.yunxin.kit:alog:1.1.0"
static def kotlinxCoroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4"
static def kotlinxCoroutinesAndroid = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
static def call = "com.netease.yunxin.kit.call:call:2.1.0"
static def call = "com.netease.yunxin.kit.call:call:2.2.0"
static def okhttp = "com.squareup.okhttp3:okhttp:4.9.3"
static def okhttpLoggingInterceptor = "com.squareup.okhttp3:logging-interceptor:4.9.3"
static def retrofitCore = "com.squareup.retrofit2:retrofit:2.9.0"
static def retrofitConverterGson = "com.squareup.retrofit2:converter-gson:2.9.0"

static class Nertc {
def nenn = "com.netease.yunxin:nertc-nenn:5.5.2"
def segment = "com.netease.yunxin:nertc-segment:5.5.2"
}

static def nertc
}
8 changes: 2 additions & 6 deletions NLiteAVDemo-Android-Java/call-ui/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<uses-sdk tools:overrideLibrary="jp.wasabeef.glide.transformations"/>

Expand All @@ -30,14 +31,9 @@

<activity
android:name=".base.TransferHelperActivity"
android:configChanges="uiMode|screenSize|smallestScreenSize|orientation|keyboardHidden|keyboard|navigation|screenLayout|fontScale|locale|layoutDirection|density"
android:theme="@style/TranslucentStyle" />

<activity
android:name=".p2p.P2PCallActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar" />

<activity
android:name=".p2p.P2PCallFragmentActivity"
android:launchMode="singleTask"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ object CallKitUI {
if (options?.enableGroup == true) {
NEGroupCall.instance().release()
}
UserInfoExtensionHelper.userInfoHelper = null
ALog.d(TAG, "CallKitUI destroy inner, completed.")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import android.content.Context
import com.netease.yunxin.kit.call.p2p.NECallEngine
import com.netease.yunxin.kit.call.p2p.model.NECallPushConfig
import com.netease.yunxin.kit.corekit.XKitService
import com.netease.yunxin.kit.corekit.model.ResultInfo
import com.netease.yunxin.kit.corekit.model.ResultObserver
import com.netease.yunxin.kit.corekit.route.XKitRouter
import com.netease.yunxin.kit.corekit.startup.Initializer
import com.netease.yunxin.nertc.nertcvideocall.model.impl.state.CallState
import com.netease.yunxin.nertc.ui.CallKitUI.startSingleCall
import com.netease.yunxin.nertc.ui.base.CallParam
import com.netease.yunxin.nertc.ui.base.Constants
Expand All @@ -33,6 +35,28 @@ class CallKitUIService : XKitService {
}

override fun create(context: Context): XKitService {
XKitRouter.registerRouter(
Constants.PATH_IS_CALL_IDLE,
XKitRouter.RouterValue(
Constants.PATH_IS_CALL_IDLE,
object : XKitRouter.Navigator {
override fun navigate(
value: Any,
params: MutableMap<String, Any?>,
observer: ResultObserver<Any?>?
): Boolean {
observer?.onResult(
ResultInfo(
value = NECallEngine.sharedInstance().callInfo.callStatus == CallState.STATE_IDLE,
success = true
)
)
return true
}
}
)
)

XKitRouter.registerRouter(
Constants.PATH_CALL_SINGLE_PAGE,
XKitRouter.RouterValue(
Expand Down
Loading

0 comments on commit 6cea863

Please sign in to comment.