mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-19 16:46:22 +08:00
mod: restore video duration
Closes #293 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1026,7 +1026,7 @@ class VideoDetailController extends GetxController
|
|||||||
|
|
||||||
bool isQuerying = false;
|
bool isQuerying = false;
|
||||||
// 视频链接
|
// 视频链接
|
||||||
Future queryVideoUrl() async {
|
Future queryVideoUrl([Duration? defaultST]) async {
|
||||||
if (isQuerying) {
|
if (isQuerying) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1069,7 +1069,7 @@ class VideoDetailController extends GetxController
|
|||||||
if (data.dash == null && data.durl != null) {
|
if (data.dash == null && data.durl != null) {
|
||||||
videoUrl = data.durl!.first.url!;
|
videoUrl = data.durl!.first.url!;
|
||||||
audioUrl = '';
|
audioUrl = '';
|
||||||
defaultST = Duration.zero;
|
this.defaultST = defaultST ?? Duration.zero;
|
||||||
// 实际为FLV/MP4格式,但已被淘汰,这里仅做兜底处理
|
// 实际为FLV/MP4格式,但已被淘汰,这里仅做兜底处理
|
||||||
firstVideo = VideoItem(
|
firstVideo = VideoItem(
|
||||||
id: data.quality!,
|
id: data.quality!,
|
||||||
@@ -1187,7 +1187,7 @@ class VideoDetailController extends GetxController
|
|||||||
audioUrl = '';
|
audioUrl = '';
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
defaultST = Duration(milliseconds: data.lastPlayTime!);
|
this.defaultST = defaultST ?? Duration(milliseconds: data.lastPlayTime!);
|
||||||
if (autoPlay.value) {
|
if (autoPlay.value) {
|
||||||
isShowCover.value = false;
|
isShowCover.value = false;
|
||||||
await playerInit();
|
await playerInit();
|
||||||
|
|||||||
@@ -184,8 +184,12 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
onTap: () =>
|
onTap: () => {
|
||||||
{Get.back(), widget.videoDetailCtr.queryVideoUrl()},
|
Get.back(),
|
||||||
|
widget.videoDetailCtr.queryVideoUrl(
|
||||||
|
widget.videoDetailCtr.playedTime,
|
||||||
|
)
|
||||||
|
},
|
||||||
leading: const Icon(Icons.refresh_outlined, size: 20),
|
leading: const Icon(Icons.refresh_outlined, size: 20),
|
||||||
title: const Text('重载视频', style: titleStyle),
|
title: const Text('重载视频', style: titleStyle),
|
||||||
),
|
),
|
||||||
@@ -288,7 +292,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
SmartDialog.showToast(
|
SmartDialog.showToast(
|
||||||
'已设置为 ${CDNServiceCode.fromCode(result)!.description},正在重载视频');
|
'已设置为 ${CDNServiceCode.fromCode(result)!.description},正在重载视频');
|
||||||
setState(() {});
|
setState(() {});
|
||||||
widget.videoDetailCtr.queryVideoUrl();
|
widget.videoDetailCtr.queryVideoUrl(
|
||||||
|
widget.videoDetailCtr.playedTime,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user