完善了直播调用的
This commit is contained in:
@@ -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