Skip to content

Commit b1acd8f

Browse files
authored
Update index.md
添加前后贴说明
1 parent a92c0c3 commit b1acd8f

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

docs/index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,39 @@ mVideoPlusView.startService(ServiceType.ServiceTypeVideoMode, new HashMap<String
415415
416416
```
417417

418+
## 前后贴
418419

420+
`视联网模式`的启动方式差不多,第一个ServiceType是个枚举。
421+
422+
```
423+
// ServiceTypeVideoMode(1),//视联网模式
424+
// ServiceTypeFrontVideo(3),//前帖广告
425+
// ServiceTypeLaterVideo(4),//后贴广告
426+
// ServiceTypePauseAd(5);//暂停广告
427+
428+
HashMap<String, String> params = new HashMap<>();
429+
// duration 参数指定倒计时
430+
params.put("duration", "60");
431+
mVideoPlusView.startService(ServiceType.ServiceTypeFrontVideo, params, new IServiceCallback() {
432+
@Override
433+
public void onCompleteForService() {
434+
435+
}
436+
437+
@Override
438+
public void onFailToCompleteForService(Throwable throwable) {
439+
if (type == ServiceType.ServiceTypeFrontVideo) {
440+
VenvyUIUtil.runOnUIThread(new Runnable() {
441+
@Override
442+
public void run() {
443+
mVideoPlayer.startPlayLogic();
444+
}
445+
});
446+
}
447+
}
448+
});
449+
450+
```
419451

420452

421453
## 其他

0 commit comments

Comments
 (0)