[Fix]修复两分钟后自动开始推流的bug
This commit is contained in:
@@ -5,6 +5,7 @@ import android.media.AudioFormat;
|
||||
import android.os.Handler;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import com.elegant.log.simplelog.Logger;
|
||||
import com.mogo.cloud.live.listener.ILiveStatusListener;
|
||||
import com.mogo.cloud.live.model.CommandModel;
|
||||
import com.mogo.cloud.live.server.PushService;
|
||||
@@ -12,7 +13,6 @@ import com.mogo.cloud.live.socket.SocketMsgUtils;
|
||||
import com.mogo.cloud.live.socket.SocketRequestUtils;
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener;
|
||||
import com.mogo.cloud.socket.entity.MsgBody;
|
||||
import com.mogo.cloud.utils.logger.Logger;
|
||||
|
||||
|
||||
/**
|
||||
@@ -79,8 +79,11 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
|
||||
livePushHandler(obj.getType(), obj.getVideoChannel());
|
||||
}
|
||||
});
|
||||
// 初始化查询摄像头状态
|
||||
restartCamStatusLoop();
|
||||
// 是自定义推流才开启上报摄像头状态
|
||||
if (isExpressEngine) {
|
||||
// 初始化查询摄像头状态
|
||||
restartCamStatusLoop();
|
||||
}
|
||||
// 开启房间人数检测
|
||||
restartCheckOnlineNumLoop();
|
||||
}
|
||||
@@ -103,6 +106,7 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
|
||||
mLivePushConfig.setAudioFormat(AudioFormat.ENCODING_PCM_16BIT);
|
||||
mLivePushConfig.setMute(true);
|
||||
mLivePushConfig.setDevicesId(devicesId);
|
||||
mLivePushConfig.setExpressEngine(isExpressEngine);
|
||||
// 初始化直播
|
||||
mMoGoLiveManager = MoGoLiveManager.getInstance().init(mApplication, mLivePushConfig);
|
||||
}
|
||||
@@ -214,7 +218,9 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
|
||||
if (mMoGoLiveManager.getLiveStatusModel().isPushing() &&
|
||||
mMoGoLiveManager.getLiveStatusModel().getOnlineNumber() <= 1) {
|
||||
livePushHandler(PUSH_STOP, C1);
|
||||
} else {
|
||||
}
|
||||
if (!mMoGoLiveManager.getLiveStatusModel().isPushing() &&
|
||||
mMoGoLiveManager.getLiveStatusModel().getOnlineNumber() >= 2) {
|
||||
livePushHandler(PUSH_START, C1);
|
||||
}
|
||||
restartCheckOnlineNumLoop();
|
||||
|
||||
@@ -164,9 +164,7 @@ public class MoGoLiveManager {
|
||||
public MoGoLiveManager init(Application application, MoGoLivePushConfig livePushConfig) {
|
||||
mApplication = application;
|
||||
mLivePushConfig = livePushConfig;
|
||||
if (mLivePushConfig.isExpressEngine()) {
|
||||
initExpressEngine();
|
||||
}
|
||||
initExpressEngine();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -489,8 +487,11 @@ public class MoGoLiveManager {
|
||||
|
||||
// 将视频信息设置到推流引擎
|
||||
mExpressEngine.setVideoConfig(zegoVideoConfig);
|
||||
|
||||
if (mLivePushConfig.isExpressEngine()) {
|
||||
initCustomVideoCapture();
|
||||
}
|
||||
}
|
||||
initCustomVideoCapture();
|
||||
loginRoom();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,25 +27,25 @@ SNAPSHOT_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-snapshots/
|
||||
USERNAME=xintai
|
||||
PASSWORD=xintai2018
|
||||
# 编译模式: false - 依赖本地版本, true - 依赖 maven 版本
|
||||
RELEASE=false
|
||||
RELEASE=true
|
||||
# AI CLOUD 云平台
|
||||
# 工具类
|
||||
MOGO_UTILS_VERSION=1.1.58-live
|
||||
MOGO_UTILS_VERSION=1.1.59-live
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.1.58-live
|
||||
MOGO_NETWORK_VERSION=1.1.59-live
|
||||
# 网络DNS
|
||||
MOGO_HTTPDNS_VERSION=1.1.58-live
|
||||
MOGO_HTTPDNS_VERSION=1.1.59-live
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.1.58-live
|
||||
MOGO_PASSPORT_VERSION=1.1.59-live
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.1.58-live
|
||||
MOGO_SOCKET_VERSION=1.1.59-live
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.1.58-live
|
||||
MOGO_REALTIME_VERSION=1.1.59-live
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.1.58-live
|
||||
MOGO_TANLU_VERSION=1.1.59-live
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.1.58-live
|
||||
MOGO_LIVE_VERSION=1.1.59-live
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.58-live
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.59-live
|
||||
# 定位服务
|
||||
MOGO_LOCATION_VERSION=1.1.58-live
|
||||
MOGO_LOCATION_VERSION=1.1.59-live
|
||||
|
||||
Reference in New Issue
Block a user