Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-04 11:13:50 +08:00
parent 2e614fa03c
commit 3208661a52
8 changed files with 120 additions and 70 deletions

View File

@@ -224,12 +224,18 @@ class VideoHttp {
if (res.data['code'] == 0) {
late PlayUrlModel data;
switch (videoType) {
case VideoType.ugc || VideoType.pugv:
case VideoType.ugc:
data = PlayUrlModel.fromJson(res.data['data']);
case VideoType.pugv:
var result = res.data['data'];
data = PlayUrlModel.fromJson(result)
..lastPlayTime =
result?['play_view_business_info']?['user_status']?['watch_progress']?['current_watch_progress'];
case VideoType.pgc:
data = PlayUrlModel.fromJson(res.data['result']['video_info'])
..lastPlayTime = res
.data['result']?['play_view_business_info']?['user_status']?['watch_progress']?['current_watch_progress'];
var result = res.data['result'];
data = PlayUrlModel.fromJson(result['video_info'])
..lastPlayTime =
result?['play_view_business_info']?['user_status']?['watch_progress']?['current_watch_progress'];
}
return {'status': true, 'data': data};
} else {
@@ -639,6 +645,7 @@ class VideoHttp {
// 视频播放进度
static Future heartBeat({
aid,
bvid,
cid,
progress,
@@ -647,10 +654,11 @@ class VideoHttp {
subType,
required VideoType videoType,
}) async {
final isPugv = videoType == VideoType.pugv;
await Request().post(
Api.heartBeat,
queryParameters: {
'bvid': bvid,
if (isPugv) 'aid': ?aid else 'bvid': ?bvid,
'cid': cid,
'epid': ?epid,
'sid': ?seasonId,