Skip to content

Commit d6da6bd

Browse files
author
videopls
committed
VideoPlusController.stop()移除所有View
1 parent a866fe8 commit d6da6bd

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

VideoOS/venvy_pub/src/main/java/cn/com/videopls/pub/VideoPlusController.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ public void startService(final ServiceType serviceType, final HashMap<String, St
151151
Log.e("Video++", "startService api 调用参数为空");
152152
return;
153153
}
154-
if (mPlatform == null) {
155-
mPlatform = initPlatform(mVideoPlusAdapter);
156-
}
154+
mPlatform = initPlatform(mVideoPlusAdapter);
157155
params.put(VenvySchemeUtil.QUERY_PARAMETER_ADS_TYPE, String.valueOf(serviceType.getId()));
158156
startQueryConnect(serviceType, params, new IStartQueryResult() {
159157
@Override
@@ -403,9 +401,7 @@ protected void navigation(Uri uri, HashMap<String, String> params, IRouterCallba
403401
return;
404402
}
405403

406-
if (mPlatform == null) {
407-
mPlatform = initPlatform(mVideoPlusAdapter);
408-
}
404+
mPlatform = initPlatform(mVideoPlusAdapter);
409405

410406
PostInfo postInfo = VenvyRouterManager.getInstance().setUri(uri)
411407
.withTargetPlatform("platform", mPlatform)
@@ -688,9 +684,7 @@ public void startVisionProgram(final String appletId, final String data, final i
688684
if (mContentView != null) {
689685
mContentView.setVisibility(View.VISIBLE);
690686
}
691-
if (this.mPlatform == null) {
692-
this.mPlatform = initPlatform(mVideoPlusAdapter);
693-
}
687+
this.mPlatform = initPlatform(mVideoPlusAdapter);
694688
VisionProgramConfigModel model = new VisionProgramConfigModel(mPlatform, appletId, isH5Type, new VisionProgramConfigModel.VisionProgramConfigCallback() {
695689

696690
@Override

VideoOS/venvy_pub/src/main/java/cn/com/videopls/pub/VideoPlusView.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,21 @@ public void stop() {
215215
if (programViewA != null) {
216216
programViewA.stop();
217217
}
218+
219+
if (programViewB != null) {
220+
programViewB.closeAllProgram();
221+
// programViewB = null;
222+
}
223+
224+
if (programTopLevel != null) {
225+
programTopLevel.stop();
226+
programTopLevel = null;
227+
}
228+
229+
if (programViewDesktop != null) {
230+
programViewDesktop.stop();
231+
programViewDesktop = null;
232+
}
218233
}
219234

220235
/**

0 commit comments

Comments
 (0)