增加了房间观看人数增加通知
This commit is contained in:
@@ -34,6 +34,7 @@ import im.zego.zegoexpress.entity.ZegoCustomVideoCaptureConfig;
|
||||
import im.zego.zegoexpress.entity.ZegoEngineConfig;
|
||||
import im.zego.zegoexpress.entity.ZegoLogConfig;
|
||||
import im.zego.zegoexpress.entity.ZegoPlayStreamQuality;
|
||||
import im.zego.zegoexpress.entity.ZegoRoomConfig;
|
||||
import im.zego.zegoexpress.entity.ZegoStream;
|
||||
import im.zego.zegoexpress.entity.ZegoUser;
|
||||
import im.zego.zegoexpress.entity.ZegoVideoConfig;
|
||||
@@ -167,6 +168,7 @@ public class MoGoLiveManager {
|
||||
*/
|
||||
private IZegoEventHandler mEventHandler = new IZegoEventHandler() {
|
||||
|
||||
// 调试错误信息回调
|
||||
@Override
|
||||
public void onDebugError(int errorCode, String funcName, String info) {
|
||||
super.onDebugError(errorCode, funcName, info);
|
||||
@@ -178,6 +180,7 @@ public class MoGoLiveManager {
|
||||
stopPublishingStream();
|
||||
}
|
||||
|
||||
// 音视频引擎状态更新回调
|
||||
@Override
|
||||
public void onEngineStateUpdate(ZegoEngineState state) {
|
||||
super.onEngineStateUpdate(state);
|
||||
@@ -214,6 +217,7 @@ public class MoGoLiveManager {
|
||||
}
|
||||
}
|
||||
|
||||
// 房间内其他用户增加或减少的通知回调
|
||||
@Override
|
||||
public void onRoomUserUpdate(String roomID, ZegoUpdateType updateType, ArrayList<ZegoUser> userList) {
|
||||
super.onRoomUserUpdate(roomID, updateType, userList);
|
||||
@@ -221,6 +225,7 @@ public class MoGoLiveManager {
|
||||
Log.i(TAG, "onRoomUserUpdate roomId : " + roomID + " , updateType : " + updateType.name());
|
||||
}
|
||||
|
||||
// 相同房间内其他用户推的流增加或减少的通知
|
||||
@Override
|
||||
public void onRoomStreamUpdate(String roomID, ZegoUpdateType updateType, ArrayList<ZegoStream> streamList, JSONObject extendedData) {
|
||||
super.onRoomStreamUpdate(roomID, updateType, streamList, extendedData);
|
||||
@@ -228,6 +233,7 @@ public class MoGoLiveManager {
|
||||
Log.i(TAG, "onRoomStreamUpdate roomId : " + roomID + " , ZegoUpdateType : " + updateType.name());
|
||||
}
|
||||
|
||||
// 推流状态回调
|
||||
@Override
|
||||
public void onPublisherStateUpdate(String streamID, ZegoPublisherState state,
|
||||
int errorCode, JSONObject extendedData) {
|
||||
@@ -236,6 +242,7 @@ public class MoGoLiveManager {
|
||||
isPushing = state == ZegoPublisherState.PUBLISHING;
|
||||
}
|
||||
|
||||
// 拉流状态变更回调
|
||||
@Override
|
||||
public void onPlayerStateUpdate(String streamID, ZegoPlayerState state, int errorCode, JSONObject extendedData) {
|
||||
super.onPlayerStateUpdate(streamID, state, errorCode, extendedData);
|
||||
@@ -243,12 +250,14 @@ public class MoGoLiveManager {
|
||||
isPlaying = state == ZegoPlayerState.PLAYING;
|
||||
}
|
||||
|
||||
// 拉流质量回调
|
||||
@Override
|
||||
public void onPlayerQualityUpdate(String streamID, ZegoPlayStreamQuality quality) {
|
||||
super.onPlayerQualityUpdate(streamID, quality);
|
||||
Log.i(TAG, "onPlayerQualityUpdate quality : " + quality.toString());
|
||||
}
|
||||
|
||||
// 网络模式变更回调
|
||||
@Override
|
||||
public void onNetworkModeChanged(ZegoNetworkMode mode) {
|
||||
super.onNetworkModeChanged(mode);
|
||||
@@ -287,7 +296,9 @@ public class MoGoLiveManager {
|
||||
currentRoomId = ROOM_ID_PREFIX + roomId;
|
||||
currentStreamId = STREAM_ID_PREFIX + roomId;
|
||||
ZegoUser zegoUser = new ZegoUser(userId, NAME_PREFIX + userId);
|
||||
mExpressEngine.loginRoom(currentRoomId, zegoUser);
|
||||
ZegoRoomConfig zegoRoomConfig = new ZegoRoomConfig();
|
||||
zegoRoomConfig.isUserStatusNotify = true;
|
||||
mExpressEngine.loginRoom(currentRoomId, zegoUser, zegoRoomConfig);
|
||||
Log.i(TAG, "loginRoom userId:" + userId + " currentRoomId : " + currentRoomId
|
||||
+ " currentStreamId:" + currentStreamId);
|
||||
}
|
||||
@@ -361,7 +372,7 @@ public class MoGoLiveManager {
|
||||
if (!TextUtils.isEmpty(currentRoomId)) {
|
||||
mExpressEngine.logoutRoom(currentRoomId);
|
||||
}
|
||||
if(customVideoCaptureConfig == null){
|
||||
if (customVideoCaptureConfig == null) {
|
||||
// 创建自定义视频采集对象
|
||||
customVideoCaptureConfig = new ZegoCustomVideoCaptureConfig();
|
||||
// 设置自定义视频采集视频帧数据类型
|
||||
|
||||
@@ -114,7 +114,7 @@ public class LiveStreamUtils implements IMogoCloudSocketOnMessageListener<Comman
|
||||
if (C1.equals(videoChannel)) {
|
||||
// 停止直播
|
||||
if (status == PUSH_STOP) {
|
||||
PushService.startService(mContext, PushService.ACTION_STOP_RTMP_PUSH, LiveStreamManagerImpl.mDevicesId);
|
||||
//PushService.startService(mContext, PushService.ACTION_STOP_RTMP_PUSH, LiveStreamManagerImpl.mDevicesId);
|
||||
}
|
||||
// 开始直播
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user