add[声望升级-修复BUG]

This commit is contained in:
Martin 2024-05-15 15:55:31 +08:00
parent cb376aa83a
commit 93dbee14b3
13 changed files with 156 additions and 84 deletions

View File

@ -268,6 +268,8 @@ public class Constants {
public static final int LIVE_SDK_KSY = 0;//金山推流 public static final int LIVE_SDK_KSY = 0;//金山推流
public static final int LIVE_SDK_TX = 1;//腾讯推流 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_NORMAL = 0;//观众与主播连麦
public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦 public static final int LINK_MIC_TYPE_ANCHOR = 1;//主播与主播连麦

View File

@ -25,6 +25,12 @@
android:id="@+id/video_view" android:id="@+id/video_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/videoFrameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>

View File

@ -1499,4 +1499,5 @@
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string> <string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string> <string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
<string name="main_type_theater">短劇</string> <string name="main_type_theater">短劇</string>
<string name="pking_over">主播正在PK稍後再試</string>
</resources> </resources>

View File

@ -1498,4 +1498,5 @@
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string> <string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string> <string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
<string name="main_type_theater">短劇</string> <string name="main_type_theater">短劇</string>
<string name="pking_over">主播正在PK稍後再試</string>
</resources> </resources>

View File

@ -1495,5 +1495,6 @@
<string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string> <string name="dragon_rule6">2.用戶關注主播並參與活動,將在倒計時五分鐘結束後瓜分活動金豆;</string>
<string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string> <string name="dragon_rule7">3.此活動的最終解釋權歸PDLIVE所有。</string>
<string name="main_type_theater">短劇</string> <string name="main_type_theater">短劇</string>
<string name="pking_over">主播正在PK稍後再試</string>
</resources> </resources>

View File

@ -1504,4 +1504,5 @@ Limited ride And limited avatar frame</string>
<string name="dragon_rule6">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;</string> <string name="dragon_rule6">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;</string>
<string name="dragon_rule7">3.The final interpretation of this activity belongs to PDLIVE.</string> <string name="dragon_rule7">3.The final interpretation of this activity belongs to PDLIVE.</string>
<string name="main_type_theater" >Theater</string> <string name="main_type_theater" >Theater</string>
<string name="pking_over">The anchor is in PK, please try again later</string>
</resources> </resources>

View File

@ -1,4 +1,4 @@
package com.yunbao.common.views.weight; package io.agora.beautyapi.faceunity.agora;
import android.app.Activity; import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
@ -7,6 +7,7 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
import android.widget.FrameLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import androidx.cardview.widget.CardView; import androidx.cardview.widget.CardView;
@ -19,6 +20,8 @@ import com.lzf.easyfloat.interfaces.OnInvokeView;
import com.tencent.rtmp.ITXLivePlayListener; import com.tencent.rtmp.ITXLivePlayListener;
import com.tencent.rtmp.TXLivePlayer; import com.tencent.rtmp.TXLivePlayer;
import com.tencent.rtmp.ui.TXCloudVideoView; 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.R;
import com.yunbao.common.bean.LiveBean; import com.yunbao.common.bean.LiveBean;
import com.yunbao.common.dialog.HintDialog; 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.http.HttpClient;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.views.floatingview.APPEasyFloat; import com.yunbao.common.views.floatingview.APPEasyFloat;
import com.yunbao.common.views.floatingview.FloatingMagnetView; import com.yunbao.common.views.floatingview.FloatingMagnetView;
import com.yunbao.common.views.floatingview.MagnetViewListener; import com.yunbao.common.views.floatingview.MagnetViewListener;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import kotlin.Unit; import kotlin.Unit;
import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function1;
@ -50,12 +55,14 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
private FloatCallbacks.Builder builder; private FloatCallbacks.Builder builder;
private String TAG = "LiveFloatView"; private String TAG = "LiveFloatView";
private TXLivePlayer mPlayer; private TXLivePlayer mPlayer;
private FrameLayout videoFrameLayout;
private TXCloudVideoView videoView;
private SWAuManager swAuManager;
public static LiveFloatView getInstance() { public static LiveFloatView getInstance() {
if (instance == null) { if (instance == null) {
instance = new LiveFloatView(); instance = new LiveFloatView();
} }
return instance; return instance;
} }
@ -79,39 +86,53 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
cardParams.height = DpUtil.dp2px(224); cardParams.height = DpUtil.dp2px(224);
cardParams.width = DpUtil.dp2px(126); cardParams.width = DpUtil.dp2px(126);
} }
TXCloudVideoView videoView = magnetView.findViewById(R.id.video_view); if(mLiveSDK == Constants.LIVE_SDK_SW){
mPlayer = new TXLivePlayer(mContext); L.eSw("mLiveSDK == Constants.LIVE_S2222222222222222");
mPlayer.setPlayerView(videoView); videoFrameLayout = magnetView.findViewById(R.id.videoFrameLayout);
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV); swAuManager = SWAuManager.get();
mPlayer.setPlayListener(new ITXLivePlayListener() { swAuManager.setAudienceContainer(videoFrameLayout);
@Override swAuManager.initRtcEngine( mContext);
public void onPlayEvent(int event, Bundle param) { swAuManager.setupRemoteVideo(Integer.parseInt(mLiveBean.getUid()));
float videoWidth = param.getInt("EVT_PARAM1", 0); //进入主播房间
float videoHeight = param.getInt("EVT_PARAM2", 0); swAuManager.joinRoom(CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, SWAuManager.getChannelName(mLiveBean.getUid()));
Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight); }else{
if (mLiveBean.getLandscape() != 1){ videoView = magnetView.findViewById(R.id.video_view);
if (videoWidth > 720) { mPlayer = new TXLivePlayer(mContext);
cardParams.height = DpUtil.dp2px(190); mPlayer.setPlayerView(videoView);
cardParams.width = DpUtil.dp2px(255); mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
} else { mPlayer.setPlayListener(new ITXLivePlayListener() {
cardParams.height = DpUtil.dp2px(224); @Override
cardParams.width = DpUtil.dp2px(126); 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() { ViewClicksAntiShake.clicksAntiShake(magnetView.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
mPlayer.stopPlay(true); if(mLiveSDK == Constants.LIVE_SDK_SW){
SWAuManager.get().exitChannelAll();
}else{
mPlayer.stopPlay(true);
}
APPEasyFloat.getInstance().dismiss(mContext); APPEasyFloat.getInstance().dismiss(mContext);
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) { if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
HintDialog fragment = new HintDialog(); HintDialog fragment = new HintDialog();
@ -122,13 +143,20 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
} }
} }
}); });
ViewClicksAntiShake.clicksAntiShake(videoView, () -> { if(mLiveSDK == Constants.LIVE_SDK_SW){
mPlayer.stopPlay(true); ViewClicksAntiShake.clicksAntiShake(videoFrameLayout, () -> {
APPEasyFloat.getInstance().dismiss(mContext); mPlayer.stopPlay(true);
new Handler().post(liveCheck); APPEasyFloat.getInstance().dismiss(mContext);
new Handler().post(liveCheck);
});
}else{
ViewClicksAntiShake.clicksAntiShake(videoView, () -> {
mPlayer.stopPlay(true);
APPEasyFloat.getInstance().dismiss(mContext);
new Handler().post(liveCheck);
});
}
});
} }
@Override @Override
@ -164,7 +192,7 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
public LiveFloatView cacheLiveData(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) { public LiveFloatView cacheLiveData(LiveBean mLiveBean, int mLiveType, int mLiveSDK, int mLiveTypeVal) {
this.mLiveBean = mLiveBean; this.mLiveBean = mLiveBean;
this.mLiveType = mLiveType; this.mLiveType = mLiveType;
this.mLiveSDK = mLiveSDK; this.mLiveSDK = Constants.LIVE_SDK_SW;
this.mLiveTypeVal = mLiveTypeVal; this.mLiveTypeVal = mLiveTypeVal;
return instance; return instance;
} }
@ -202,7 +230,8 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
@Override @Override
public void invoke(View view) { 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); CardView layout = view.findViewById(R.id.layout);
RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams(); RelativeLayout.LayoutParams cardParams = (RelativeLayout.LayoutParams) layout.getLayoutParams();
if (mLiveBean.getLandscape() == 1) { if (mLiveBean.getLandscape() == 1) {
@ -213,39 +242,54 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
cardParams.width = DpUtil.dp2px(126); cardParams.width = DpUtil.dp2px(126);
} }
layout.setLayoutParams(cardParams); layout.setLayoutParams(cardParams);
mPlayer = new TXLivePlayer(mContext); if(mLiveSDK == Constants.LIVE_SDK_SW){
mPlayer.setPlayerView(videoView); L.eSw("mLiveSDK == Constants.LIVE_SDK_SW mLive1111111");
mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV); swAuManager = SWAuManager.get();
mPlayer.setPlayListener(new ITXLivePlayListener() { swAuManager.setAudienceContainer(videoFrameLayout);
@Override swAuManager.initRtcEngine( mContext);
public void onPlayEvent(int event, Bundle param) { swAuManager.setupRemoteVideo(Integer.parseInt(mLiveBean.getUid()));
float videoWidth = param.getInt("EVT_PARAM1", 0); //进入主播房间
float videoHeight = param.getInt("EVT_PARAM2", 0); swAuManager.joinRoom(CommonAppConfig.getInstance().getUid(), CommonAppConfig.SWToken, SWAuManager.getChannelName(mLiveBean.getUid()));
Log.e("视频流有", "videoWidth:" + videoWidth + " videoHeight:" + videoHeight); }else{
if (mLiveBean.getLandscape() != 1){ TXCloudVideoView videoView = view.findViewById(R.id.video_view);
if (videoWidth > 720) { mPlayer = new TXLivePlayer(mContext);
cardParams.height = DpUtil.dp2px(190); mPlayer.setPlayerView(videoView);
cardParams.width = DpUtil.dp2px(255); mPlayer.startPlay(url, TXLivePlayer.PLAY_TYPE_LIVE_FLV);
} else { mPlayer.setPlayListener(new ITXLivePlayListener() {
cardParams.height = DpUtil.dp2px(224); @Override
cardParams.width = DpUtil.dp2px(126); 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() { ViewClicksAntiShake.clicksAntiShake(view.findViewById(R.id.btn_close), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
mPlayer.stopPlay(true); if(mLiveSDK == Constants.LIVE_SDK_SW){
SWAuManager.get().exitChannelAll();
}else{
mPlayer.stopPlay(true);
}
EasyFloat.dismiss("LiveFloatView", true); EasyFloat.dismiss("LiveFloatView", true);
if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) { if (IMLoginManager.get(mContext).isHint2() && !((FragmentActivity) mContext).getSupportFragmentManager().isDestroyed()) {
HintDialog fragment = new HintDialog(); HintDialog fragment = new HintDialog();
@ -257,8 +301,11 @@ public class LiveFloatView implements Function1<FloatCallbacks.Builder, Unit> {
} }
}); });
ViewClicksAntiShake.clicksAntiShake(view, () -> { ViewClicksAntiShake.clicksAntiShake(view, () -> {
if(mLiveSDK == Constants.LIVE_SDK_SW){
mPlayer.stopPlay(true); SWAuManager.get().exitChannelAll();
}else{
mPlayer.stopPlay(true);
}
new Handler().post(liveCheck); new Handler().post(liveCheck);

View File

@ -309,7 +309,10 @@ public class SWAuManager extends BaseCacheManager {
* 退出所有的直播间 * 退出所有的直播间
*/ */
public void exitChannelAll() { public void exitChannelAll() {
mRtcEngine.leaveChannel(); L.eSw("exitChannelAll exitChannelAll exitChannelAll");
if(mRtcEngine!=null){
mRtcEngine.leaveChannel();
}
} }
public static String getChannelName(String liveUid) { public static String getChannelName(String liveUid) {

View File

@ -885,7 +885,7 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
} }
}); });
} else { } else {
ToastUtil.show("主播正在PK稍後再試"); ToastUtil.show(getString(R.string.pking_over));
} }
} }
} }

View File

@ -68,6 +68,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Random; import java.util.Random;
import io.agora.beautyapi.faceunity.agora.SWAuManager;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
@ -791,6 +792,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
* 退出直播间 * 退出直播间
*/ */
private void close() { private void close() {
SWAuManager.get().exitChannelAll();
handler.removeCallbacks(runnable); handler.removeCallbacks(runnable);
handler1.removeCallbacks(runnable1); handler1.removeCallbacks(runnable1);
((LiveAudienceActivity) mContext).onBackPressed(); ((LiveAudienceActivity) mContext).onBackPressed();

View File

@ -226,7 +226,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
* @param Uid * @param Uid
*/ */
public void setPkView(String Uid) { public void setPkView(String Uid) {
L.eSw("setPkView Uid "+Uid); L.eSw("setPkView Uid " + Uid);
mPkContainer.setVisibility(View.VISIBLE); mPkContainer.setVisibility(View.VISIBLE);
swAuManager.updateMyChannelView((FrameLayout) mLeftContainer, Integer.parseInt(liveUid)); swAuManager.updateMyChannelView((FrameLayout) mLeftContainer, Integer.parseInt(liveUid));
ry_view.removeAllViews(); ry_view.removeAllViews();
@ -242,13 +242,13 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
@Override @Override
public void setDrMicInfo(UserBean u) { public void setDrMicInfo(UserBean u) {
isAdd = true; 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++) { 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; isAdd = false;
} }
} }
L.eSw("setDrMicInfo:---------------isAdd--"+isAdd ); L.eSw("setDrMicInfo:---------------isAdd--" + isAdd);
//加载多人PK(连麦)主播视图 //加载多人PK(连麦)主播视图
if (isAdd) { if (isAdd) {
dr_pk_view.setVisibility(View.VISIBLE); dr_pk_view.setVisibility(View.VISIBLE);
@ -281,7 +281,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if (info.length > 0) { if (info.length > 0) {
JSONObject obj = JSONObject.parseObject(info[0]); JSONObject obj = JSONObject.parseObject(info[0]);
List<DrPkbean> drPkbeans = JSONObject.parseArray(obj.getString("userlist"), DrPkbean.class); List<DrPkbean> drPkbeans = JSONObject.parseArray(obj.getString("userlist"), DrPkbean.class);
int removeIndex = -1; int removeIndex = -1;
for (int i = 0; i < drPkbeans.size(); i++) { for (int i = 0; i < drPkbeans.size(); i++) {
if (liveUid.equals(String.valueOf(drPkbeans.get(i).getId()))) { if (liveUid.equals(String.valueOf(drPkbeans.get(i).getId()))) {
@ -312,7 +312,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
} }
} }
public void setDrPkView(List<DrPkbean> drPkbeanList){ public void setDrPkView(List<DrPkbean> drPkbeanList) {
if (detailsView1 != null) { if (detailsView1 != null) {
dr1_preview.removeView(detailsView1); dr1_preview.removeView(detailsView1);
} }
@ -405,14 +405,13 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
} }
/** /**
* 退出单人pk * 退出单人pk
* *
* @param pkUid * @param pkUid
*/ */
public void endpk(String pkUid) { public void endpk(String pkUid) {
L.eSw("endpk "+pkUid); L.eSw("endpk " + pkUid);
mPkContainer.setVisibility(View.GONE); mPkContainer.setVisibility(View.GONE);
swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), SWAuManager.getChannelName(pkUid)); swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), SWAuManager.getChannelName(pkUid));
swAuManager.updateMyChannelView(ry_view, Integer.parseInt(liveUid)); swAuManager.updateMyChannelView(ry_view, Integer.parseInt(liveUid));
@ -438,7 +437,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
for (int i = 0; i < drMicUserList.size(); i++) { for (int i = 0; i < drMicUserList.size(); i++) {
swAuManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), drMicUserList.get(i).getId()); 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)); swAuManager.updateMyChannelView((FrameLayout) ry_view, Integer.parseInt(liveUid));
} }
@ -666,7 +665,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
mStarted = false; mStarted = false;
Bus.getOff(this); Bus.getOff(this);
EventBus.getDefault().unregister(this); EventBus.getDefault().unregister(this);
swAuManager.exitChannelAll(); //swAuManager.exitChannelAll();
L.e(TAG, "release------->"); L.e(TAG, "release------->");
} }
@ -919,15 +918,26 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder {
mVideoView.requestLayout(); mVideoView.requestLayout();
} }
boolean isShow = false;
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void onUpdata(String str) { public void onUpdata(String str) {
if ("UsertoRY".equals(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 @Override
public void onConfirmClick(Dialog dialog, String content) { public void onConfirmClick(Dialog dialog, String content) {
UsertoRY(); 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"); url = url.replace(".flv", videoRatioHorizontal[PLAY_MODEL_480] + videoFps[0] + ".flv");
} }
} }
private class ExoPlayerListener implements Player.Listener { private class ExoPlayerListener implements Player.Listener {
String TAG = "播放流"; String TAG = "播放流";

View File

@ -82,7 +82,6 @@ import com.yunbao.common.utils.StringUtil;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.utils.formatBigNum;
import com.yunbao.common.views.weight.LiveFloatView;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity; 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.IRCRTCResultCallback;
import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback; import cn.rongcloud.rtc.api.callback.IRCRTCSwitchRoleCallback;
import cn.rongcloud.rtc.base.RTCErrorCode; 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.IRongCallback;
import io.rong.imlib.IRongCoreCallback; import io.rong.imlib.IRongCoreCallback;
import io.rong.imlib.IRongCoreEnum; import io.rong.imlib.IRongCoreEnum;
@ -326,7 +327,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public void run() { public void run() {
loading.setVisibility(View.GONE); loading.setVisibility(View.GONE);
enterRoomLeaveHandler.post(enterRoomLeaveRunnable); 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.removeFromParent();
mLiveRoomViewHolder.countDownTimerTrickery = null; mLiveRoomViewHolder.countDownTimerTrickery = null;
} }
mLiveAudienceViewHolder = null; mLiveAudienceViewHolder = null;
mLivePlayViewHolder = null; mLivePlayViewHolder = null;
mLiveRoomViewHolder = null; mLiveRoomViewHolder = null;
@ -1940,6 +1940,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
if (!isEnterRoom) { if (!isEnterRoom) {
return; return;
} }
SWAuManager.get().exitChannelAll();
LiveNetManager.get(mContext) LiveNetManager.get(mContext)
.leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() { .leaveRoomNew(leaveStream, leaveGroupId, new com.yunbao.common.http.base.HttpCallback<String>() {
@Override @Override

View File

@ -13,8 +13,6 @@ import android.app.PendingIntent;
import android.content.ClipData; import android.content.ClipData;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -57,7 +55,6 @@ import com.yunbao.common.Constants;
import com.yunbao.common.activity.AbsActivity; import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.activity.WebViewActivity; import com.yunbao.common.activity.WebViewActivity;
import com.yunbao.common.adapter.ViewPagerAdapter; import com.yunbao.common.adapter.ViewPagerAdapter;
import com.yunbao.common.bean.AnchorRecommendItemModel;
import com.yunbao.common.bean.AnchorRecommendModel; import com.yunbao.common.bean.AnchorRecommendModel;
import com.yunbao.common.bean.AnchorStartLiveBean; import com.yunbao.common.bean.AnchorStartLiveBean;
import com.yunbao.common.bean.ChatRemarksBean; 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.DpUtil;
import com.yunbao.common.utils.GiftCacheUtil; import com.yunbao.common.utils.GiftCacheUtil;
import com.yunbao.common.utils.GoogleUtils; import com.yunbao.common.utils.GoogleUtils;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LiveRoomCheckLivePresenter; import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
import com.yunbao.common.utils.LocationUtil; import com.yunbao.common.utils.LocationUtil;
import com.yunbao.common.utils.ProcessResultUtil; 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.APKUpdateCustomPopup;
import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.common.views.floatingview.APPEasyFloat; import com.yunbao.common.views.floatingview.APPEasyFloat;
import com.yunbao.common.views.weight.LiveFloatView;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.utils.LiveStorge; import com.yunbao.live.utils.LiveStorge;
import com.yunbao.main.R; 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.RCRTCConfig;
import cn.rongcloud.rtc.api.RCRTCEngine; import cn.rongcloud.rtc.api.RCRTCEngine;
import io.agora.beautyapi.faceunity.agora.LiveFloatView;
import io.reactivex.Observer; import io.reactivex.Observer;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.rong.imkit.config.RongConfigCenter; import io.rong.imkit.config.RongConfigCenter;