完善了直播调用的
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -26,7 +26,6 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -34,15 +34,6 @@ public interface ILiveProgressListener {
|
||||
*/
|
||||
void onDisConnect();
|
||||
|
||||
/**
|
||||
* 当房间数据流更新
|
||||
*
|
||||
* @param streamId 直播流ID
|
||||
* @param isLive 是否是直播
|
||||
*/
|
||||
default void onRoomStreamUpdate(String streamId, boolean isLive) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 调试错误信息回调
|
||||
*
|
||||
|
||||
@@ -44,11 +44,6 @@ public interface ILiveStreamManager {
|
||||
*/
|
||||
void setLiveStatusChangeCallback(ILiveStatusListener changeCallback);
|
||||
|
||||
/**
|
||||
* 设置网络环境
|
||||
*/
|
||||
void setNetEnvironment(int environment);
|
||||
|
||||
/**
|
||||
* 释放资源
|
||||
*/
|
||||
|
||||
@@ -72,11 +72,6 @@ public class LiveStreamManagerImpl implements ILiveStreamManager {
|
||||
mLiveStreamUtils.setLiveStatusChangeCallback(callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNetEnvironment(int environment) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
mLiveStreamUtils.release();
|
||||
|
||||
@@ -226,15 +226,6 @@ public class MoGoLiveManager {
|
||||
super.onRoomStreamUpdate(roomID, updateType, streamList, extendedData);
|
||||
//有用户新推送或者删除音视频时,更新流状态
|
||||
Log.i(TAG, "onRoomStreamUpdate roomId : " + roomID + " , ZegoUpdateType : " + updateType.name());
|
||||
for (ZegoStream stream : streamList) {
|
||||
String streamID = stream.streamID;
|
||||
Log.i(TAG, "onRoomStreamUpdate streamId: " + streamID);
|
||||
if (listener != null && updateType == ZegoUpdateType.ADD) {
|
||||
listener.onRoomStreamUpdate(streamID, true);
|
||||
} else {
|
||||
listener.onRoomStreamUpdate(streamID, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -66,6 +66,10 @@ public class TrafficLiveManager implements ILiveProgressListener {
|
||||
MoGoLiveManager.getInstance().init(application, null);
|
||||
MoGoLiveManager.getInstance().loginRoom(sn, liveSn);
|
||||
MoGoLiveManager.getInstance().setLiveProgressListener(TrafficLiveManager.this);
|
||||
|
||||
// 直接 查看对应SN的直播
|
||||
MoGoLiveManager.getInstance().startLive(surfaceView);
|
||||
callBack.onLive();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,19 +133,6 @@ public class TrafficLiveManager implements ILiveProgressListener {
|
||||
callBack.onDisConnect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoomStreamUpdate(String streamId, boolean isLive) {
|
||||
if (streamId != null && isLive) {
|
||||
Logger.i(TAG, "主播开始直播了");
|
||||
mStreamId = streamId;
|
||||
MoGoLiveManager.getInstance().startLive(surfaceView);
|
||||
callBack.onLive();
|
||||
} else {
|
||||
Logger.i(TAG, "主播已离线");
|
||||
callBack.onLiveStop(); //todo 验证 onStop() 与 onRoomStreamUpdate() 回调时机 前后顺序
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDebugError(int errorCode, String funcName, String errorInfo) {
|
||||
Logger.e(TAG, "onDebugError errorCode : " + errorCode + " funcName : " + funcName + " errorInfo : " + errorInfo);
|
||||
|
||||
Reference in New Issue
Block a user