fix bug of logic in destory
This commit is contained in:
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@@ -26,6 +26,7 @@
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
@@ -166,7 +166,7 @@ public class MoGoLiveManager {
|
||||
/**
|
||||
* 事件回调用
|
||||
*/
|
||||
private IZegoEventHandler mEventHandler = new IZegoEventHandler() {
|
||||
private final IZegoEventHandler mEventHandler = new IZegoEventHandler() {
|
||||
|
||||
// 调试错误信息回调
|
||||
@Override
|
||||
@@ -280,9 +280,7 @@ public class MoGoLiveManager {
|
||||
* 销毁即构引擎
|
||||
*/
|
||||
private void destroyEngine() {
|
||||
ZegoExpressEngine.destroyEngine(() -> {
|
||||
|
||||
});
|
||||
ZegoExpressEngine.destroyEngine(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -414,7 +412,7 @@ public class MoGoLiveManager {
|
||||
* 停止直播
|
||||
*/
|
||||
public void stopLive() {
|
||||
if (!TextUtils.isEmpty(currentStreamId)) {
|
||||
if (!TextUtils.isEmpty(currentStreamId) && mExpressEngine != null) {
|
||||
mExpressEngine.stopPlayingStream(currentStreamId);
|
||||
}
|
||||
stopPreview();
|
||||
@@ -493,7 +491,6 @@ public class MoGoLiveManager {
|
||||
* 停止观看直播
|
||||
*/
|
||||
public void onDestroyLive() {
|
||||
logOutRoom();
|
||||
destroyEngine();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,15 +87,14 @@ public class TrafficLiveManager implements ILiveProgressListener {
|
||||
requestLiveManager.requestVehicleHeadLive(LIVE_TYPE_CLOSE, liveSn, new IRequestLiveListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
MoGoLiveManager.getInstance().stopLive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
MoGoLiveManager.getInstance().stopLive();
|
||||
callBack.onError(e.getMessage());
|
||||
}
|
||||
});
|
||||
MoGoLiveManager.getInstance().stopLive();
|
||||
surfaceView = null;
|
||||
callBack = null;
|
||||
isLoginSuccess = false;
|
||||
|
||||
Reference in New Issue
Block a user