mod: restore video duration

Closes #293

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-20 21:07:50 +08:00
parent f759dba7da
commit 19890e29e9
2 changed files with 12 additions and 6 deletions

View File

@@ -1026,7 +1026,7 @@ class VideoDetailController extends GetxController
bool isQuerying = false;
// 视频链接
Future queryVideoUrl() async {
Future queryVideoUrl([Duration? defaultST]) async {
if (isQuerying) {
return;
}
@@ -1069,7 +1069,7 @@ class VideoDetailController extends GetxController
if (data.dash == null && data.durl != null) {
videoUrl = data.durl!.first.url!;
audioUrl = '';
defaultST = Duration.zero;
this.defaultST = defaultST ?? Duration.zero;
// 实际为FLV/MP4格式但已被淘汰这里仅做兜底处理
firstVideo = VideoItem(
id: data.quality!,
@@ -1187,7 +1187,7 @@ class VideoDetailController extends GetxController
audioUrl = '';
}
//
defaultST = Duration(milliseconds: data.lastPlayTime!);
this.defaultST = defaultST ?? Duration(milliseconds: data.lastPlayTime!);
if (autoPlay.value) {
isShowCover.value = false;
await playerInit();