主播开播问题

This commit is contained in:
18401019693 2022-09-01 15:20:52 +08:00
parent f9d26a6d56
commit 1a186ac8cf
4 changed files with 17 additions and 29 deletions

View File

@ -683,10 +683,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
public void endLives() {
//断开socket
if (mSocketRyClient != null) {
mSocketRyClient.disConnect();
}
RCRTCEngine.getInstance().getDefaultVideoStream().stopCamera(new IRCRTCResultCallback() {
@Override
@ -762,10 +759,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
SocketRyChatUtil.closeLive(datas.getString("votes"), datas.getString("length"), datas.getString("nums"), mLiveUid, mSocketRyClient);
//断开socket
if (mSocketRyClient != null) {
mSocketRyClient.disConnect();
}
if (mLiveEndViewHolder == null) {
mLiveEndViewHolder = new LiveEndViewHolder(mContext, mRoot, mLiveBean.getUid());
@ -786,8 +779,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
mLivePushViewHolder = null;
mLiveLinkMicPresenter = null;
release();
mStartLive = false;
} else {
@ -848,6 +839,10 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveReadyViewHolder = null;
mLivePushViewHolder = null;
mLiveLinkMicPresenter = null;
//断开socket
if (mSocketRyClient != null) {
mSocketRyClient.disConnect();
}
super.release();
}

View File

@ -1,19 +1,20 @@
package com.yunbao.live.adapter;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.yunbao.common.Constants;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.bean.LiveFunctionBean;
import com.yunbao.common.interfaces.OnItemClickListener;
import java.util.ArrayList;
import java.util.List;
@ -35,23 +36,14 @@ public class LiveFunctionAdapter extends RecyclerView.Adapter<LiveFunctionAdapte
mList = new ArrayList<>();
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_BEAUTY, R.mipmap.icon_live_func_beauty, R.string.live_beauty));
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_CAMERA, R.mipmap.icon_live_func_camera, R.string.live_camera));
// mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_MIRROR, R.mipmap.icon_horizontally, R.string.live_camera_s));
// mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_FLASH, openFlash ? R.mipmap.icon_live_func_flash : R.mipmap.icon_live_func_flash_1, R.string.live_flash));
// mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_MUSIC, R.mipmap.icon_live_func_music, R.string.live_music));
// mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_SHARE, R.mipmap.icon_live_func_share, R.string.live_share));
// // TODO: 2019-11-15
// if (hasGame) {//含有游戏
// mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_GAME, R.mipmap.icon_live_func_game, R.string.live_game));
// }
// mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_RED_PACK, R.mipmap.icon_live_func_rp, R.string.live_red_pack));
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_LINK_MIC, R.mipmap.icon_danrenpk, R.string.live_link_pk));
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_DR, R.mipmap.icon_duorenpk, R.string.live_dr));
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_MIC, R.mipmap.icon_microphone, R.string.live_mic));
if (!(context instanceof LiveRyAnchorActivity)) {
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_MIC, R.mipmap.icon_microphone, R.string.live_mic));
}
if(LiveRyAnchorActivity.mLivePushViewHolder!=null ) {
if (LiveRyAnchorActivity.mLivePushViewHolder != null) {
if (LiveRyAnchorActivity.leave == 0) {
mList.add(new LiveFunctionBean(Constants.LIVE_FUNC_ZSLK, R.mipmap.icon_leave, R.string.live_zslk));
} else {

View File

@ -1902,7 +1902,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
public void run() {
// try {
// Thread.sleep(4000);
if ( LiveAudienceActivity.getmLivePlayViewHolder() != null) {
if (mContext instanceof LiveAudienceActivity && LiveAudienceActivity.getmLivePlayViewHolder() != null) {
LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
}
// } catch (InterruptedException e) {

View File

@ -62,7 +62,8 @@ public class SocketRyChatUtil {
@Override
public void onSuccess(Message message) {
Log.i("tx", "发送成功");
SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + "");
if (SocketRyClient.mSocketHandler != null)
SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + "");
}
@Override