fix bug of logic in destory

This commit is contained in:
zhongchao
2021-02-07 17:33:07 +08:00
parent 36864d2ef9
commit 09a4080ab3
3 changed files with 5 additions and 8 deletions

1
.idea/gradle.xml generated
View File

@@ -26,6 +26,7 @@
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>

View File

@@ -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();
}
}

View File

@@ -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;