mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-23 02:26:52 +08:00
feat: prefetch live room danmu (#4)
This commit is contained in:
@@ -289,6 +289,11 @@ class Api {
|
||||
static const String liveRoomInfoH5 =
|
||||
'${HttpString.liveBaseUrl}/xlive/web-room/v1/index/getH5InfoByRoom';
|
||||
|
||||
// 直播间弹幕预获取
|
||||
// roomid roomId
|
||||
static const String liveRoomDmPrefetch =
|
||||
'${HttpString.liveBaseUrl}/xlive/web-room/v1/dM/gethistory';
|
||||
|
||||
//直播间弹幕密钥获取接口
|
||||
static const String liveRoomDmToken =
|
||||
'${HttpString.liveBaseUrl}/xlive/web-room/v1/index/getDanmuInfo';
|
||||
|
||||
@@ -111,6 +111,21 @@ class LiveHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future liveRoomDanmaPrefetch({roomId}) async {
|
||||
var res = await Request().get(Api.liveRoomDmPrefetch, data: {
|
||||
'roomid': roomId,
|
||||
});
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': res.data['data']['room']};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static Future liveRoomGetDanmakuToken({roomId}) async {
|
||||
var res = await Request().get(Api.liveRoomDmToken, data: {
|
||||
'id': roomId,
|
||||
|
||||
Reference in New Issue
Block a user