修复30秒检测是否关闭直播的逻辑
This commit is contained in:
@@ -65,14 +65,14 @@
|
||||
android:label="路况服务"
|
||||
android:launchMode="singleTask" />
|
||||
|
||||
<receiver android:name=".wifi.WifiBroadCastReceiver">
|
||||
<!-- <receiver android:name=".wifi.WifiBroadCastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.net.wifi.RSSI_CHANGED" />
|
||||
<action android:name="android.net.wifi.STATE_CHANGE" />
|
||||
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
|
||||
</intent-filter>
|
||||
|
||||
</receiver>
|
||||
</receiver>-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -28,7 +28,7 @@ public class LivePlayAndPushActivity extends BaseLiveActivity
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
WifiStateManager.getInstance().registerWifiStateListener(this);
|
||||
// WifiStateManager.getInstance().registerWifiStateListener(this);
|
||||
|
||||
// 初始化直播流管理
|
||||
liveStreamManager = LiveStreamManagerImpl.getInstance(this.getApplication(),
|
||||
@@ -119,7 +119,7 @@ public class LivePlayAndPushActivity extends BaseLiveActivity
|
||||
|
||||
MoGoAiCloudTrafficLive.stopLive(liveSn);
|
||||
MoGoAiCloudTrafficLive.destroyLive();
|
||||
WifiStateManager.getInstance().unRegisterWifiStateListener(this);
|
||||
// WifiStateManager.getInstance().unRegisterWifiStateListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -172,6 +172,9 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
|
||||
uploadCamStatus(sCam1AvailableStatus, sCam2AvailableStatus);
|
||||
restartCamStatusLoop();
|
||||
// 判断当前观众的个数,如果没人观看了的情况则停止直播
|
||||
Logger.i(TAG, "直播状态为: " + mLivePusher.isPushing() +
|
||||
" 观众人数:" + mLivePusher.getOnlineNumber());
|
||||
|
||||
if (mLivePusher.isPushing() && mLivePusher.getOnlineNumber() <= 1) {
|
||||
livePushHandler(PUSH_STOP, C1);
|
||||
}
|
||||
|
||||
@@ -251,10 +251,13 @@ public class MoGoLiveManager {
|
||||
@Override
|
||||
public void onRoomOnlineUserCountUpdate(String roomID, int count) {
|
||||
super.onRoomOnlineUserCountUpdate(roomID, count);
|
||||
onlineNumber = count;
|
||||
Logger.i(TAG, "onRoomOnlineUserCountUpdate roomID : " + roomID + " , online user number : " + onlineNumber);
|
||||
if (mRoomStatusListener != null) {
|
||||
mRoomStatusListener.onRoomOnlineUserCountUpdate(count);
|
||||
// 这里只处理当前设备登录的房间中的用户总数
|
||||
if (currentRoomId.equals(roomID)) {
|
||||
onlineNumber = count;
|
||||
Logger.i(TAG, "onRoomOnlineUserCountUpdate roomID : " + roomID + " , online user number : " + onlineNumber);
|
||||
if (mRoomStatusListener != null) {
|
||||
mRoomStatusListener.onRoomOnlineUserCountUpdate(count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +265,6 @@ public class MoGoLiveManager {
|
||||
@Override
|
||||
public void onRoomUserUpdate(String roomID, ZegoUpdateType updateType, ArrayList<ZegoUser> userList) {
|
||||
super.onRoomUserUpdate(roomID, updateType, userList);
|
||||
onlineNumber = userList.size();
|
||||
Logger.i(TAG, "onRoomUserUpdate roomId : " + roomID + " , updateType : " + updateType.name() + " , online user number : " + onlineNumber);
|
||||
if (mRoomStatusListener != null) {
|
||||
mRoomStatusListener.onRoomUserUpdate(updateType, userList);
|
||||
|
||||
Reference in New Issue
Block a user