From 93dbee14b3201f991987261333cfec210e107a06 Mon Sep 17 00:00:00 2001 From: Martin <13046765170@163.com> Date: Wed, 15 May 2024 15:55:31 +0800 Subject: [PATCH] =?UTF-8?q?add[=E5=A3=B0=E6=9C=9B=E5=8D=87=E7=BA=A7-?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DBUG]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/Constants.java | 2 + .../src/main/res/layout/view_flaot_live.xml | 6 + common/src/main/res/values-zh-rHK/strings.xml | 1 + common/src/main/res/values-zh-rTW/strings.xml | 1 + common/src/main/res/values-zh/strings.xml | 1 + common/src/main/res/values/strings.xml | 1 + .../faceunity/agora}/LiveFloatView.java | 171 +++++++++++------- .../faceunity/agora/SWAuManager.java | 5 +- .../live/activity/LiveAnchorActivity.java | 2 +- .../live/views/LiveAudienceViewHolder.java | 2 + .../live/views/LivePlayRyViewHolder.java | 35 ++-- .../live/views/PortraitLiveManager.java | 7 +- .../yunbao/main/activity/MainActivity.java | 6 +- 13 files changed, 156 insertions(+), 84 deletions(-) rename {common/src/main/java/com/yunbao/common/views/weight => lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora}/LiveFloatView.java (59%) diff --git a/common/src/main/java/com/yunbao/common/Constants.java b/common/src/main/java/com/yunbao/common/Constants.java index a0ea5df91..4a3e42403 100644 --- a/common/src/main/java/com/yunbao/common/Constants.java +++ b/common/src/main/java/com/yunbao/common/Constants.java @@ -268,6 +268,8 @@ public class Constants { public static final int LIVE_SDK_KSY = 0;//金山推流 public static final int LIVE_SDK_TX = 1;//腾讯推流 + public static final int LIVE_SDK_SW = 2;//声网 + public static final int LINK_MIC_TYPE_NORMAL = 0;//观众与主播连麦 public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦 diff --git a/common/src/main/res/layout/view_flaot_live.xml b/common/src/main/res/layout/view_flaot_live.xml index 5b1d2d4db..715547e35 100644 --- a/common/src/main/res/layout/view_flaot_live.xml +++ b/common/src/main/res/layout/view_flaot_live.xml @@ -25,6 +25,12 @@ android:id="@+id/video_view" android:layout_width="match_parent" android:layout_height="match_parent" /> + + + diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 423420996..6122bf711 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1499,4 +1499,5 @@ 2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆; 3.此活動的最終解釋權歸PDLIVE所有。 短劇 + 主播正在PK,稍後再試 diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index fc5fa7cc7..97460c705 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1498,4 +1498,5 @@ 2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆; 3.此活動的最終解釋權歸PDLIVE所有。 短劇 + 主播正在PK,稍後再試 diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index b328ddb56..0765a70d7 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1495,5 +1495,6 @@ 2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆; 3.此活動的最終解釋權歸PDLIVE所有。 短劇 + 主播正在PK,稍後再試 diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 1a36a41c6..f7d9f1a4f 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1504,4 +1504,5 @@ Limited ride And limited avatar frame 2.Users who follow the anchor and participate in the activity will divide the gold beans of the activity after the countdown of five minutes ends; 3.The final interpretation of this activity belongs to PDLIVE. Theater + The anchor is in PK, please try again later diff --git a/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/LiveFloatView.java similarity index 59% rename from common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java rename to lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/LiveFloatView.java index 0f9efc7de..e09f22338 100644 --- a/common/src/main/java/com/yunbao/common/views/weight/LiveFloatView.java +++ b/lib_faceunity/src/main/java/io/agora/beautyapi/faceunity/agora/LiveFloatView.java @@ -1,4 +1,4 @@ -package com.yunbao.common.views.weight; +package io.agora.beautyapi.faceunity.agora; import android.app.Activity; import android.os.Bundle; @@ -7,6 +7,7 @@ import android.text.TextUtils; import android.util.Log; import android.view.Gravity; import android.view.View; +import android.widget.FrameLayout; import android.widget.RelativeLayout; import androidx.cardview.widget.CardView; @@ -19,6 +20,8 @@ import com.lzf.easyfloat.interfaces.OnInvokeView; import com.tencent.rtmp.ITXLivePlayListener; import com.tencent.rtmp.TXLivePlayer; import com.tencent.rtmp.ui.TXCloudVideoView; +import com.yunbao.common.CommonAppConfig; +import com.yunbao.common.Constants; import com.yunbao.common.R; import com.yunbao.common.bean.LiveBean; import com.yunbao.common.dialog.HintDialog; @@ -26,10 +29,12 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.L; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.views.floatingview.APPEasyFloat; import com.yunbao.common.views.floatingview.FloatingMagnetView; import com.yunbao.common.views.floatingview.MagnetViewListener; +import com.yunbao.common.views.weight.ViewClicksAntiShake; import kotlin.Unit; import kotlin.jvm.functions.Function1; @@ -50,12 +55,14 @@ public class LiveFloatView implements Function1 { private FloatCallbacks.Builder builder; private String TAG = "LiveFloatView"; private TXLivePlayer mPlayer; + private FrameLayout videoFrameLayout; + private TXCloudVideoView videoView; + private SWAuManager swAuManager; public static LiveFloatView getInstance() { if (instance == null) { instance = new LiveFloatView(); } - return instance; } @@ -79,39 +86,53 @@ public class LiveFloatView implements Function1 { cardParams.height = DpUtil.dp2px(224); cardParams.width = DpUtil.dp2px(126); } - TXCloudVideoView videoView = magnetView.findViewById(R.id.video_view); - mPlayer = new TXLivePlayer(mContext); - mPlayer.setPlayerView(videoView); - mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV); - mPlayer.setPlayListener(new ITXLivePlayListener() { - @Override - public void onPlayEvent(int event, Bundle param) { - float videoWidth = param.getInt("EVT_PARAM1", 0); - float videoHeight = param.getInt("EVT_PARAM2", 0); - Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight); - if (mLiveBean.getLandscape() != 1){ - if (videoWidth > 720) { - cardParams.height = DpUtil.dp2px(190); - cardParams.width = DpUtil.dp2px(255); - } else { - cardParams.height = DpUtil.dp2px(224); - cardParams.width = DpUtil.dp2px(126); + if(mLiveSDK == Constants.LIVE_SDK_SW){ + L.eSw("mLiveSDK == Constants.LIVE_S2222222222222222"); + videoFrameLayout = magnetView.findViewById(R.id.videoFrameLayout); + swAuManager = SWAuManager.get(); + swAuManager.setAudienceContainer(videoFrameLayout); + swAuManager.initRtcEngine( mContext); + swAuManager.setupRemoteVideo(Integer.parseInt(mLiveBean.getUid())); + //进入主播房间 + swAuManager.joinRoom(CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, SWAuManager.getChannelName(mLiveBean.getUid())); + }else{ + videoView = magnetView.findViewById(R.id.video_view); + mPlayer = new TXLivePlayer(mContext); + mPlayer.setPlayerView(videoView); + mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV); + mPlayer.setPlayListener(new ITXLivePlayListener() { + @Override + public void onPlayEvent(int event, Bundle param) { + float videoWidth = param.getInt("EVT_PARAM1", 0); + float videoHeight = param.getInt("EVT_PARAM2", 0); + Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight); + if (mLiveBean.getLandscape() != 1){ + if (videoWidth > 720) { + cardParams.height = DpUtil.dp2px(190); + cardParams.width = DpUtil.dp2px(255); + } else { + cardParams.height = DpUtil.dp2px(224); + cardParams.width = DpUtil.dp2px(126); + } + layout.setLayoutParams(cardParams); } - layout.setLayoutParams(cardParams); } - } + @Override + public void onNetStatus(Bundle bundle) { - @Override - public void onNetStatus(Bundle bundle) { + } + }); + } - - } - }); ViewClicksAntiShake.clicksAntiShake(magnetView.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - mPlayer.stopPlay(true); + if(mLiveSDK == Constants.LIVE_SDK_SW){ + SWAuManager.get().exitChannelAll(); + }else{ + mPlayer.stopPlay(true); + } APPEasyFloat.getInstance().dismiss(mContext); if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) { HintDialog fragment = new HintDialog(); @@ -122,13 +143,20 @@ public class LiveFloatView implements Function1 { } } }); - ViewClicksAntiShake.clicksAntiShake(videoView, () -> { - mPlayer.stopPlay(true); - APPEasyFloat.getInstance().dismiss(mContext); - new Handler().post(liveCheck); + if(mLiveSDK == Constants.LIVE_SDK_SW){ + ViewClicksAntiShake.clicksAntiShake(videoFrameLayout, () -> { + mPlayer.stopPlay(true); + APPEasyFloat.getInstance().dismiss(mContext); + new Handler().post(liveCheck); + }); + }else{ + ViewClicksAntiShake.clicksAntiShake(videoView, () -> { + mPlayer.stopPlay(true); + APPEasyFloat.getInstance().dismiss(mContext); + new Handler().post(liveCheck); + }); + } - - }); } @Override @@ -164,7 +192,7 @@ public class LiveFloatView implements Function1 { public LiveFloatView cacheLiveData(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) { this.mLiveBean = mLiveBean; this.mLiveType = mLiveType; - this.mLiveSDK = mLiveSDK; + this.mLiveSDK = Constants.LIVE_SDK_SW; this.mLiveTypeVal = mLiveTypeVal; return instance; } @@ -202,7 +230,8 @@ public class LiveFloatView implements Function1 { @Override public void invoke(View view) { - TXCloudVideoView videoView = view.findViewById(R.id.video_view); + videoFrameLayout = view.findViewById(R.id.videoFrameLayout); + L.eSw("invoke(View view) invoke(View view) invoke(View view) invoke(View view) "); CardView layout = view.findViewById(R.id.layout); RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams(); if (mLiveBean.getLandscape() == 1) { @@ -213,39 +242,54 @@ public class LiveFloatView implements Function1 { cardParams.width = DpUtil.dp2px(126); } layout.setLayoutParams(cardParams); - mPlayer = new TXLivePlayer(mContext); - mPlayer.setPlayerView(videoView); - mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV); - mPlayer.setPlayListener(new ITXLivePlayListener() { - @Override - public void onPlayEvent(int event, Bundle param) { - float videoWidth = param.getInt("EVT_PARAM1", 0); - float videoHeight = param.getInt("EVT_PARAM2", 0); - Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight); - if (mLiveBean.getLandscape() != 1){ - if (videoWidth > 720) { - cardParams.height = DpUtil.dp2px(190); - cardParams.width = DpUtil.dp2px(255); - } else { - cardParams.height = DpUtil.dp2px(224); - cardParams.width = DpUtil.dp2px(126); + if(mLiveSDK == Constants.LIVE_SDK_SW){ + L.eSw("mLiveSDK == Constants.LIVE_SDK_SW mLive1111111"); + swAuManager = SWAuManager.get(); + swAuManager.setAudienceContainer(videoFrameLayout); + swAuManager.initRtcEngine( mContext); + swAuManager.setupRemoteVideo(Integer.parseInt(mLiveBean.getUid())); + //进入主播房间 + swAuManager.joinRoom(CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, SWAuManager.getChannelName(mLiveBean.getUid())); + }else{ + TXCloudVideoView videoView = view.findViewById(R.id.video_view); + mPlayer = new TXLivePlayer(mContext); + mPlayer.setPlayerView(videoView); + mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV); + mPlayer.setPlayListener(new ITXLivePlayListener() { + @Override + public void onPlayEvent(int event, Bundle param) { + float videoWidth = param.getInt("EVT_PARAM1", 0); + float videoHeight = param.getInt("EVT_PARAM2", 0); + Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight); + if (mLiveBean.getLandscape() != 1){ + if (videoWidth > 720) { + cardParams.height = DpUtil.dp2px(190); + cardParams.width = DpUtil.dp2px(255); + } else { + cardParams.height = DpUtil.dp2px(224); + cardParams.width = DpUtil.dp2px(126); + } + layout.setLayoutParams(cardParams); } - layout.setLayoutParams(cardParams); + } - } - - @Override - public void onNetStatus(Bundle bundle) { - - } - }); + @Override + public void onNetStatus(Bundle bundle) { + } + }); + } ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - mPlayer.stopPlay(true); + if(mLiveSDK == Constants.LIVE_SDK_SW){ + SWAuManager.get().exitChannelAll(); + }else{ + mPlayer.stopPlay(true); + } + EasyFloat.dismiss("LiveFloatView", true); if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) { HintDialog fragment = new HintDialog(); @@ -257,8 +301,11 @@ public class LiveFloatView implements Function1 { } }); ViewClicksAntiShake.clicksAntiShake(view, () -> { - - mPlayer.stopPlay(true); + if(mLiveSDK == Constants.LIVE_SDK_SW){ + SWAuManager.get().exitChannelAll(); + }else{ + mPlayer.stopPlay(true); + } new Handler().post(liveCheck); 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 7d46c50b9..26ceb75c6 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 @@ -309,7 +309,10 @@ public class SWAuManager extends BaseCacheManager { * 退出所有的直播间 */ public void exitChannelAll() { - mRtcEngine.leaveChannel(); + L.eSw("exitChannelAll exitChannelAll exitChannelAll"); + if(mRtcEngine!=null){ + mRtcEngine.leaveChannel(); + } } public static String getChannelName(String liveUid) { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java index 0f979153b..282a8dac0 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveAnchorActivity.java @@ -885,7 +885,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic } }); } else { - ToastUtil.show("主播正在PK,稍後再試"); + ToastUtil.show(getString(R.string.pking_over)); } } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 08eccaa73..0a3d60e56 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -68,6 +68,7 @@ import java.util.List; import java.util.Locale; import java.util.Random; +import io.agora.beautyapi.faceunity.agora.SWAuManager; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; @@ -791,6 +792,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { * 退出直播间 */ private void close() { + SWAuManager.get().exitChannelAll(); handler.removeCallbacks(runnable); handler1.removeCallbacks(runnable1); ((LiveAudienceActivity) mContext).onBackPressed(); diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index dc6695a97..37fd85f13 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -226,7 +226,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { * @param Uid */ public void setPkView(String Uid) { - L.eSw("setPkView Uid "+Uid); + L.eSw("setPkView Uid " + Uid); mPkContainer.setVisibility(View.VISIBLE); swAuManager.updateMyChannelView((FrameLayout) mLeftContainer, Integer.parseInt(liveUid)); ry_view.removeAllViews(); @@ -242,13 +242,13 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Override public void setDrMicInfo(UserBean u) { isAdd = true; - L.eSw("setDrMicInfo:-----------------" + u.getId()+" drMicUserList"+new Gson().toJson(drMicUserList)); + L.eSw("setDrMicInfo:-----------------" + u.getId() + " drMicUserList" + new Gson().toJson(drMicUserList)); for (int i = 0; i < drMicUserList.size(); i++) { - if (u.getId().equals(drMicUserList.get(i).getId())||u.getId().equals(liveUid)) { + if (u.getId().equals(drMicUserList.get(i).getId()) || u.getId().equals(liveUid)) { isAdd = false; } } - L.eSw("setDrMicInfo:---------------isAdd--"+isAdd ); + L.eSw("setDrMicInfo:---------------isAdd--" + isAdd); //加载多人PK(连麦)主播视图 if (isAdd) { dr_pk_view.setVisibility(View.VISIBLE); @@ -281,7 +281,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { public void onSuccess(int code, String msg, String[] info) { if (info.length > 0) { JSONObject obj = JSONObject.parseObject(info[0]); - List drPkbeans = JSONObject.parseArray(obj.getString("userlist"), DrPkbean.class); + List drPkbeans = JSONObject.parseArray(obj.getString("userlist"), DrPkbean.class); int removeIndex = -1; for (int i = 0; i < drPkbeans.size(); i++) { if (liveUid.equals(String.valueOf(drPkbeans.get(i).getId()))) { @@ -312,7 +312,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { } } - public void setDrPkView(List drPkbeanList){ + public void setDrPkView(List drPkbeanList) { if (detailsView1 != null) { dr1_preview.removeView(detailsView1); } @@ -405,14 +405,13 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { } - /** * 退出单人pk * * @param pkUid */ public void endpk(String pkUid) { - L.eSw("endpk "+pkUid); + L.eSw("endpk " + pkUid); mPkContainer.setVisibility(View.GONE); swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), SWAuManager.getChannelName(pkUid)); swAuManager.updateMyChannelView(ry_view, Integer.parseInt(liveUid)); @@ -438,7 +437,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { for (int i = 0; i < drMicUserList.size(); i++) { swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), drMicUserList.get(i).getId()); } - drMicUserList =new ArrayList<>(); + drMicUserList = new ArrayList<>(); //將當前主播畫面放大 swAuManager.updateMyChannelView((FrameLayout) ry_view, Integer.parseInt(liveUid)); } @@ -666,7 +665,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { mStarted = false; Bus.getOff(this); EventBus.getDefault().unregister(this); - swAuManager.exitChannelAll(); + //swAuManager.exitChannelAll(); L.e(TAG, "release------->"); } @@ -919,15 +918,26 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { mVideoView.requestLayout(); } + boolean isShow = false; @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { if ("UsertoRY".equals(str)) { - DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.mic_tag), new DialogUitl.SimpleCallback() { + //todo 新增dis监听 + if (isShow) { + return; + } + isShow = true; + DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.mic_tag), new DialogUitl.SimpleCallback2() { + @Override + public void onCancelClick() { + isShow = false; + } + @Override public void onConfirmClick(Dialog dialog, String content) { UsertoRY(); - dialog = null; + isShow = false; } }); @@ -1425,6 +1435,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { url = url.replace(".flv", videoRatioHorizontal[PLAY_MODEL_480] + videoFps[0] + ".flv"); } } + private class ExoPlayerListener implements Player.Listener { String TAG = "播放流"; diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index a882f5de1..1ac6894bc 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -82,7 +82,6 @@ import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; -import com.yunbao.common.views.weight.LiveFloatView; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveAudienceActivity; @@ -122,6 +121,8 @@ import cn.rongcloud.rtc.api.RCRTCEngine; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback; import cn.rongcloud.rtc.base.RTCErrorCode; +import io.agora.beautyapi.faceunity.agora.LiveFloatView; +import io.agora.beautyapi.faceunity.agora.SWAuManager; import io.rong.imlib.IRongCallback; import io.rong.imlib.IRongCoreCallback; import io.rong.imlib.IRongCoreEnum; @@ -326,7 +327,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe public void run() { loading.setVisibility(View.GONE); enterRoomLeaveHandler.post(enterRoomLeaveRunnable); - ToastUtil.show(mContext.getString(R.string.net_error) + " :500");//异常下播,等待加载时间过了后弹出 + //ToastUtil.show(mContext.getString(R.string.net_error) + " :500");//异常下播,等待加载时间过了后弹出 } }; @@ -940,7 +941,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.removeFromParent(); mLiveRoomViewHolder.countDownTimerTrickery = null; } - mLiveAudienceViewHolder = null; mLivePlayViewHolder = null; mLiveRoomViewHolder = null; @@ -1940,6 +1940,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe if (!isEnterRoom) { return; } + SWAuManager.get().exitChannelAll(); LiveNetManager.get(mContext) .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback() { @Override diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index df83f8672..eb8874263 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -13,8 +13,6 @@ import android.app.PendingIntent; import android.content.ClipData; import android.content.Context; import android.content.Intent; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -57,7 +55,6 @@ import com.yunbao.common.Constants; import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.adapter.ViewPagerAdapter; -import com.yunbao.common.bean.AnchorRecommendItemModel; import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.AnchorStartLiveBean; import com.yunbao.common.bean.ChatRemarksBean; @@ -98,7 +95,6 @@ import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.GiftCacheUtil; import com.yunbao.common.utils.GoogleUtils; -import com.yunbao.common.utils.L; import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.LocationUtil; import com.yunbao.common.utils.ProcessResultUtil; @@ -110,7 +106,6 @@ import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.APKUpdateCustomPopup; import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.common.views.floatingview.APPEasyFloat; -import com.yunbao.common.views.weight.LiveFloatView; import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.utils.LiveStorge; import com.yunbao.main.R; @@ -148,6 +143,7 @@ import java.util.concurrent.TimeUnit; import cn.rongcloud.rtc.api.RCRTCConfig; import cn.rongcloud.rtc.api.RCRTCEngine; +import io.agora.beautyapi.faceunity.agora.LiveFloatView; import io.reactivex.Observer; import io.reactivex.disposables.Disposable; import io.rong.imkit.config.RongConfigCenter;