diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index 1c07161e5..f7cc06eb6 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -229,7 +229,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl long lossRate = statusBean.packetLostRate; //带宽 String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth; - Log.e("网速和内存", "获取视频:" +resolution+ " 丢包率:" + lossRate+" 带宽:"+googAvailableSendBandwidth); + Log.e("网速和内存", "获取视频:" + resolution + " 丢包率:" + lossRate + " 带宽:" + googAvailableSendBandwidth); } } }); @@ -1596,6 +1596,10 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl case UPDATA_ROBOT: getAiRobotStatus(); break; + //主播强制下播 + case LIVE_END: + endLive(); + break; } } diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 036bf54ea..49600b5f1 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -31,6 +31,46 @@ public class LiveAudienceEvent extends BaseModel { private int time; private CustomFullServiceNotifyEvent customFullServiceNotifyEvent; private LivePKUserListBean livePKUserListBean; + private String votes; + private String length; + private int nums; + private String uname; + + public String getVotes() { + return votes; + } + + public LiveAudienceEvent setVotes(String votes) { + this.votes = votes; + return this; + } + + public String getLength() { + return length; + } + + public LiveAudienceEvent setLength(String length) { + this.length = length; + return this; + } + + public int getNums() { + return nums; + } + + public LiveAudienceEvent setNums(int nums) { + this.nums = nums; + return this; + } + + public String getUname() { + return uname; + } + + public LiveAudienceEvent setUname(String uname) { + this.uname = uname; + return this; + } public LivePKUserListBean getLivePKUserListBean() { return livePKUserListBean; @@ -258,7 +298,8 @@ public class LiveAudienceEvent extends BaseModel { CHANGE_VIEW(52, "更改连胜位置"), UPDATA_ROBOT(53, "更新机器人消息"), LIVE_VIDEO(54, "画质选择"), - LUCKY_100_CHECK(55,"幸运百分百"); + LUCKY_100_CHECK(55, "幸运百分百"), + LIVE_END(56, "主播下播"); private int type; private String name; diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index aa8790693..8e436a47b 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -364,6 +364,13 @@ public class SocketRyClient { } else if (action == 19) { mListener.onAnchorInvalid(); } + //主播强制下播 + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.LIVE_END) + .setVotes(map.getString("votes")) + .setLength(map.getString("length")) + .setNums(map.getIntValue("nums")) + .setUname(map.getString("uname"))); break; case Constants.SOCKET_CHANGE_LIVE://主播切换计时收费类型 mListener.onChangeTimeCharge(map.getIntValue("type_val"));