Skip to content

Commit 9422c9b

Browse files
author
qinpengcheng
committed
add method pause/resume service in programTopLevelView
1 parent 94882f5 commit 9422c9b

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
* Created by yanjiangbo on 2017/5/17.
6363
*/
6464

65-
public abstract class VideoPlusController implements VenvyObserver {
65+
public class VideoPlusController implements VenvyObserver {
6666

6767
protected VideoProgramView mContentView;
6868

@@ -169,7 +169,13 @@ public void successful(CallbackType callbackType, Object result, String miniAppI
169169
}
170170
return;
171171
}
172-
mQueryAdsArray.add(queryAdsInfo);
172+
VenvyUIUtil.runOnUIThread(new Runnable() {
173+
@Override
174+
public void run() {
175+
mQueryAdsArray.add(queryAdsInfo);
176+
}
177+
});
178+
173179
Uri.Builder builder = new Uri.Builder();
174180
builder.scheme(VenvySchemeUtil.SCHEME_LUA_VIEW)
175181
.path(VenvySchemeUtil.PATH_LUA_VIEW)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,19 @@ public void reResumeService(ServiceType serviceType) {
361361
if (programViewA != null) {
362362
programViewA.reResumeService(serviceType);
363363
}
364+
365+
if (programTopLevel != null) {
366+
programTopLevel.reResumeService(serviceType);
367+
}
364368
}
365369

366370
public void pauseService(ServiceType serviceType) {
367371
if (programViewA != null) {
368372
programViewA.pauseService(serviceType);
369373
}
374+
if (programTopLevel != null) {
375+
programTopLevel.pauseService(serviceType);
376+
}
370377
}
371378

372379
public void stopService(ServiceType serviceType) {

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
* Created by Lucas on 2019/7/30.
2121
*/
2222

23-
public class VideoProgramView<T extends VideoPlusController> extends FrameLayout {
23+
public class VideoProgramView extends FrameLayout {
2424

2525

26-
private T controller;
26+
private VideoPlusController controller;
2727

2828

2929
public VideoProgramView(Context context) {
@@ -58,9 +58,7 @@ protected void onDetachedFromWindow() {
5858

5959
private void init() {
6060
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
61-
controller = (T) new VideoPlusController(this) {
62-
63-
};
61+
controller = new VideoPlusController(this);
6462
}
6563

6664
public void navigation(Uri uri, HashMap<String, String> params, IRouterCallback callback) {

0 commit comments

Comments
 (0)