修复直播状态
This commit is contained in:
parent
9d72939d95
commit
addda76eaa
@ -350,7 +350,9 @@ public class LiveUtils {
|
|||||||
|
|
||||||
public static JSONObject getLiveInfo(int roomId) {
|
public static JSONObject getLiveInfo(int roomId) {
|
||||||
return http_get("https://api.live.bilibili.com/xlive/web-room/v1/index/getInfoByRoom?room_id=" + roomId + "&protocol=0,1&format=0,1,2&codec=0,1&qn=10000&platform=web&ptype=8");
|
return http_get("https://api.live.bilibili.com/xlive/web-room/v1/index/getInfoByRoom?room_id=" + roomId + "&protocol=0,1&format=0,1,2&codec=0,1&qn=10000&platform=web&ptype=8");
|
||||||
|
}
|
||||||
|
public static JSONObject getLiveRoomInfo(int roomId){
|
||||||
|
return http_get("https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo?room_id"+ roomId + "&protocol=0,1&format=0,1,2&codec=0,1&qn=10000&platform=web&ptype=8");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getLiveState(int roomId) {
|
public static boolean getLiveState(int roomId) {
|
||||||
@ -358,12 +360,12 @@ public class LiveUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void reloadLiveState(int roomId) {
|
public static void reloadLiveState(int roomId) {
|
||||||
JSONObject json = getLiveInfo(roomId);
|
JSONObject json = getLiveRoomInfo(roomId);
|
||||||
if (json != null) {
|
if (json != null) {
|
||||||
try {
|
try {
|
||||||
liveStateMap.put(roomId, json.getJSONObject("data").getInteger("live_status") == 1);
|
liveStateMap.put(roomId, json.getJSONObject("data").getInteger("live_status") == 1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.i("live state = "+json.toString());
|
Log.i("live state = "+json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user