mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 01:56:47 +08:00
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user