mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: seek from dm
Closes #208 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1070,7 +1070,12 @@ 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 = '';
|
||||||
this.defaultST = defaultST ?? Duration.zero;
|
if (Get.arguments['progress'] != null) {
|
||||||
|
this.defaultST = Duration(milliseconds: Get.arguments['progress']);
|
||||||
|
Get.arguments['progress'] = null;
|
||||||
|
} else {
|
||||||
|
this.defaultST = defaultST ?? Duration.zero;
|
||||||
|
}
|
||||||
// 实际为FLV/MP4格式,但已被淘汰,这里仅做兜底处理
|
// 实际为FLV/MP4格式,但已被淘汰,这里仅做兜底处理
|
||||||
firstVideo = VideoItem(
|
firstVideo = VideoItem(
|
||||||
id: data.quality!,
|
id: data.quality!,
|
||||||
@@ -1188,7 +1193,13 @@ class VideoDetailController extends GetxController
|
|||||||
audioUrl = '';
|
audioUrl = '';
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
this.defaultST = defaultST ?? Duration(milliseconds: data.lastPlayTime!);
|
if (Get.arguments['progress'] != null) {
|
||||||
|
this.defaultST = Duration(milliseconds: Get.arguments['progress']);
|
||||||
|
Get.arguments['progress'] = null;
|
||||||
|
} else {
|
||||||
|
this.defaultST =
|
||||||
|
defaultST ?? Duration(milliseconds: data.lastPlayTime!);
|
||||||
|
}
|
||||||
if (autoPlay.value) {
|
if (autoPlay.value) {
|
||||||
isShowCover.value = false;
|
isShowCover.value = false;
|
||||||
await playerInit();
|
await playerInit();
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ class PiliScheme {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case 'video':
|
case 'video':
|
||||||
|
// bilibili://video/12345678?dm_progress=123000&cid=12345678&dmid=12345678
|
||||||
if (uri.queryParameters['comment_root_id'] != null) {
|
if (uri.queryParameters['comment_root_id'] != null) {
|
||||||
// to check
|
// to check
|
||||||
// to video reply
|
// to video reply
|
||||||
@@ -130,11 +131,27 @@ class PiliScheme {
|
|||||||
.firstMatch(path)
|
.firstMatch(path)
|
||||||
?.group(1);
|
?.group(1);
|
||||||
if (aid != null || bvid != null) {
|
if (aid != null || bvid != null) {
|
||||||
videoPush(
|
if (uri.queryParameters['cid'] != null) {
|
||||||
aid != null ? int.parse(aid) : null,
|
bvid ??= IdUtils.av2bv(int.parse(aid!));
|
||||||
bvid,
|
Utils.toDupNamed(
|
||||||
off: off,
|
'/video?bvid=$bvid&cid=${uri.queryParameters['cid']}',
|
||||||
);
|
arguments: {
|
||||||
|
'pic': null,
|
||||||
|
'heroTag': Utils.makeHeroTag(aid),
|
||||||
|
if (uri.queryParameters['dm_progress'] != null)
|
||||||
|
'progress':
|
||||||
|
int.tryParse(uri.queryParameters['dm_progress']!),
|
||||||
|
},
|
||||||
|
off: off,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
videoPush(
|
||||||
|
aid != null ? int.parse(aid) : null,
|
||||||
|
bvid,
|
||||||
|
off: off,
|
||||||
|
progress: uri.queryParameters['dm_progress'],
|
||||||
|
);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -529,6 +546,7 @@ class PiliScheme {
|
|||||||
String? bvid, {
|
String? bvid, {
|
||||||
bool showDialog = true,
|
bool showDialog = true,
|
||||||
bool off = false,
|
bool off = false,
|
||||||
|
String? progress,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
aid ??= IdUtils.bv2av(bvid!);
|
aid ??= IdUtils.bv2av(bvid!);
|
||||||
@@ -545,6 +563,7 @@ class PiliScheme {
|
|||||||
arguments: {
|
arguments: {
|
||||||
'pic': null,
|
'pic': null,
|
||||||
'heroTag': Utils.makeHeroTag(aid),
|
'heroTag': Utils.makeHeroTag(aid),
|
||||||
|
if (progress != null) 'progress': int.tryParse(progress),
|
||||||
},
|
},
|
||||||
off: off,
|
off: off,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user