diff --git a/common/src/main/java/com/yunbao/common/CommonAppConfig.java b/common/src/main/java/com/yunbao/common/CommonAppConfig.java index 3ec41c897..5b98684f4 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppConfig.java +++ b/common/src/main/java/com/yunbao/common/CommonAppConfig.java @@ -79,6 +79,8 @@ public class CommonAppConfig { public static String SWToken = ""; //声网Token public static final String SWChannelPrefix = "g"; + public static final String SWAPPId = "4cf0376582d742ac8a96778b25b1079e"; + /** * 获取通道 diff --git a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWAuManager.java b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWAuManager.java index 63ca6e76a..b3f9742d7 100644 --- a/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWAuManager.java +++ b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/SWAuManager.java @@ -10,6 +10,7 @@ import android.widget.FrameLayout; import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppContext; import com.yunbao.common.bean.BaseModel; +import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.UserBean; import com.yunbao.common.http.API; import com.yunbao.common.http.ResponseModel; @@ -21,6 +22,8 @@ import com.yunbao.common.utils.L; import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; +import java.util.List; + import io.agora.rtc2.ChannelMediaOptions; import io.agora.rtc2.Constants; import io.agora.rtc2.IRtcEngineEventHandler; @@ -43,9 +46,6 @@ import io.rong.message.TextMessage; */ public class SWAuManager extends BaseCacheManager { - // 填写项目的 App ID,可在声网控制台中生成 - public static final String shengwang_appId = "4cf0376582d742ac8a96778b25b1079e"; - // 填写频道名 private Activity mContext; public static SWAuManager manager; private RtcEngineEx mRtcEngine; @@ -102,7 +102,7 @@ public class SWAuManager extends BaseCacheManager { // 创建 RtcEngineConfig 对象,并进行配置 RtcEngineConfig config = new RtcEngineConfig(); config.mContext = mContext; - config.mAppId = SWAuManager.shengwang_appId; + config.mAppId = CommonAppConfig.SWAPPId; config.mEventHandler = mRtcEventHandler; // 创建并初始化 RtcEngine mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config); @@ -123,7 +123,7 @@ public class SWAuManager extends BaseCacheManager { // 创建 RtcEngineConfig 对象,并进行配置 RtcEngineConfig config = new RtcEngineConfig(); config.mContext = mContext; - config.mAppId = SWAuManager.shengwang_appId; + config.mAppId = CommonAppConfig.SWAPPId; config.mEventHandler = mEventHandler; // 创建并初始化 RtcEngine mRtcEngine = (RtcEngineEx) RtcEngineEx.create(config); @@ -415,4 +415,10 @@ public class SWAuManager extends BaseCacheManager { public interface SwListener { void onUserOffline(int liveUid); } + + public void preloadChannel(List uids){ + for (int i = 0; i