Add delay time for live

This commit is contained in:
FongMi 2023-01-09 14:43:07 +08:00
parent 215aed5d5b
commit 1391a82919
6 changed files with 22 additions and 4 deletions

View File

@ -44,6 +44,10 @@ public class Init {
get().handler.post(runnable);
}
public static void run(Runnable runnable, int delay) {
get().handler.postDelayed(runnable, delay);
}
public static void show(String msg) {
get().handler.post(() -> Toast.makeText(context(), msg, Toast.LENGTH_LONG).show());
}

View File

@ -4,6 +4,7 @@ import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.github.catvod.crawler.Spider;
@ -12,6 +13,18 @@ public class Live extends Spider {
@Override
public void init(Context context, String extend) {
super.init(context, extend);
Init.run(this::openLive, delay(extend));
}
private int delay(String extend) {
try {
return TextUtils.isEmpty(extend) ? 0 : Integer.parseInt(extend);
} catch (Throwable ignored) {
return 0;
}
}
private void openLive() {
try {
Activity activity = Init.getActivity();
activity.startActivity(new Intent().setComponent(new ComponentName(activity, "com.fongmi.android.tv.ui.activity.LiveActivity")));

Binary file not shown.

View File

@ -1 +1 @@
a1c200856bade9fe50617a55807e1747
09cb3b87750788e648fa34955e8381e8

View File

@ -1,5 +1,5 @@
{
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;a1c200856bade9fe50617a55807e1747",
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;09cb3b87750788e648fa34955e8381e8",
"wallpaper": "https://gao.chuqiuyu.tk",
"lives": [
{

View File

@ -1,5 +1,5 @@
{
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;a1c200856bade9fe50617a55807e1747",
"spider": "https://ghproxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;09cb3b87750788e648fa34955e8381e8",
"wallpaper": "http://www.kf666888.cn/api/tvbox/img",
"lives": [
{
@ -160,7 +160,8 @@
"type": 3,
"api": "csp_Live",
"searchable": 0,
"filterable": 0
"filterable": 0,
"ext": "3000"
},
{
"key": "push_agent",