mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-08-03 09:10:13 +08:00
@@ -132,6 +132,10 @@ class VideoDetailController extends GetxController
|
|||||||
String? audioUrl;
|
String? audioUrl;
|
||||||
Duration? defaultST;
|
Duration? defaultST;
|
||||||
Duration? playedTime;
|
Duration? playedTime;
|
||||||
|
String get playedTimePos {
|
||||||
|
final pos = playedTime?.inMilliseconds;
|
||||||
|
return pos == null || pos == 0 ? '' : '?t=${pos / 1000}';
|
||||||
|
}
|
||||||
|
|
||||||
// 亮度
|
// 亮度
|
||||||
double? brightness;
|
double? brightness;
|
||||||
|
|||||||
@@ -143,7 +143,8 @@ class PgcIntroController extends CommonIntroController {
|
|||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
String videoUrl = '${HttpString.baseUrl}/bangumi/play/ep$epId';
|
String videoUrl =
|
||||||
|
'${HttpString.baseUrl}/bangumi/play/ep$epId${videoDetailCtr.playedTimePos}';
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
|||||||
@@ -302,7 +302,8 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
final videoDetail = this.videoDetail.value;
|
final videoDetail = this.videoDetail.value;
|
||||||
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
|
String videoUrl =
|
||||||
|
'${HttpString.baseUrl}/video/$bvid${videoDetailCtr.playedTimePos}';
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
|
|||||||
@@ -41,6 +41,18 @@ abstract final class PiliScheme {
|
|||||||
listener = appLinks.uriLinkStream.listen(routePush);
|
listener = appLinks.uriLinkStream.listen(routePush);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int? _videoProgress(Map<String, String> queryParameters) {
|
||||||
|
if ((queryParameters['start_progress'] ?? queryParameters['dm_progress'])
|
||||||
|
case final p?) {
|
||||||
|
return int.tryParse(p);
|
||||||
|
} else if (queryParameters['t'] case final t0?) {
|
||||||
|
if (double.tryParse(t0) case final t1?) {
|
||||||
|
return (t1 * 1000).toInt();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
static Future<bool> routePushFromUrl(
|
static Future<bool> routePushFromUrl(
|
||||||
String url, {
|
String url, {
|
||||||
bool selfHandle = false,
|
bool selfHandle = false,
|
||||||
@@ -99,7 +111,7 @@ abstract final class PiliScheme {
|
|||||||
PageUtils.viewPgc(
|
PageUtils.viewPgc(
|
||||||
seasonId: isEp ? null : id,
|
seasonId: isEp ? null : id,
|
||||||
epId: isEp ? id : null,
|
epId: isEp ? id : null,
|
||||||
progress: uri.queryParameters['start_progress'],
|
progress: _videoProgress(uri.queryParameters),
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -121,7 +133,6 @@ abstract final class PiliScheme {
|
|||||||
// bilibili://video/{aid}/?comment_root_id=***&comment_secondary_id=***
|
// bilibili://video/{aid}/?comment_root_id=***&comment_secondary_id=***
|
||||||
final queryParameters = uri.queryParameters;
|
final queryParameters = uri.queryParameters;
|
||||||
if (queryParameters['comment_root_id'] != null) {
|
if (queryParameters['comment_root_id'] != null) {
|
||||||
// to check
|
|
||||||
// to video reply
|
// to video reply
|
||||||
String? oid = uriDigitRegExp.firstMatch(path)?.group(1);
|
String? oid = uriDigitRegExp.firstMatch(path)?.group(1);
|
||||||
int? rpid = int.tryParse(queryParameters['comment_root_id']!);
|
int? rpid = int.tryParse(queryParameters['comment_root_id']!);
|
||||||
@@ -146,11 +157,10 @@ abstract final class PiliScheme {
|
|||||||
final cid = queryParameters['cid'];
|
final cid = queryParameters['cid'];
|
||||||
if (cid != null) {
|
if (cid != null) {
|
||||||
bvid ??= IdUtils.av2bv(int.parse(aid!));
|
bvid ??= IdUtils.av2bv(int.parse(aid!));
|
||||||
final progress = queryParameters['dm_progress'];
|
|
||||||
PageUtils.toVideoPage(
|
PageUtils.toVideoPage(
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
cid: int.parse(cid),
|
cid: int.parse(cid),
|
||||||
progress: progress == null ? null : int.parse(progress),
|
progress: _videoProgress(queryParameters),
|
||||||
off: off,
|
off: off,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -158,7 +168,7 @@ abstract final class PiliScheme {
|
|||||||
aid != null ? int.parse(aid) : null,
|
aid != null ? int.parse(aid) : null,
|
||||||
bvid,
|
bvid,
|
||||||
off: off,
|
off: off,
|
||||||
progress: queryParameters['dm_progress'],
|
progress: _videoProgress(queryParameters),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -629,12 +639,9 @@ abstract final class PiliScheme {
|
|||||||
case 'bangumi':
|
case 'bangumi':
|
||||||
// www.bilibili.com/bangumi/play/ep{eid}?start_progress={offset}&thumb_up_dm_id={dmid}
|
// www.bilibili.com/bangumi/play/ep{eid}?start_progress={offset}&thumb_up_dm_id={dmid}
|
||||||
// if (kDebugMode) debugPrint('番剧');
|
// if (kDebugMode) debugPrint('番剧');
|
||||||
final queryParameters = uri.queryParameters;
|
|
||||||
bool hasMatch = PageUtils.viewPgcFromUri(
|
bool hasMatch = PageUtils.viewPgcFromUri(
|
||||||
path,
|
path,
|
||||||
progress:
|
progress: _videoProgress(uri.queryParameters),
|
||||||
queryParameters['start_progress'] ??
|
|
||||||
queryParameters['dm_progress'],
|
|
||||||
);
|
);
|
||||||
if (hasMatch) {
|
if (hasMatch) {
|
||||||
return true;
|
return true;
|
||||||
@@ -662,7 +669,7 @@ abstract final class PiliScheme {
|
|||||||
res.av,
|
res.av,
|
||||||
res.bv,
|
res.bv,
|
||||||
off: off,
|
off: off,
|
||||||
progress: queryParameters['dm_progress'],
|
progress: _videoProgress(queryParameters),
|
||||||
part: part,
|
part: part,
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
@@ -850,7 +857,7 @@ abstract final class PiliScheme {
|
|||||||
String? bvid, {
|
String? bvid, {
|
||||||
bool showDialog = true,
|
bool showDialog = true,
|
||||||
bool off = false,
|
bool off = false,
|
||||||
String? progress,
|
int? progress, // milliseconds
|
||||||
String? part,
|
String? part,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
@@ -872,7 +879,7 @@ abstract final class PiliScheme {
|
|||||||
aid: aid,
|
aid: aid,
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
cid: cid,
|
cid: cid,
|
||||||
progress: progress == null ? null : int.parse(progress),
|
progress: progress,
|
||||||
off: off,
|
off: off,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -736,7 +736,7 @@ abstract final class PageUtils {
|
|||||||
int? pgcType,
|
int? pgcType,
|
||||||
String? cover,
|
String? cover,
|
||||||
String? title,
|
String? title,
|
||||||
int? progress,
|
int? progress, // milliseconds
|
||||||
Map? extraArguments,
|
Map? extraArguments,
|
||||||
bool off = false,
|
bool off = false,
|
||||||
}) {
|
}) {
|
||||||
@@ -773,7 +773,7 @@ abstract final class PageUtils {
|
|||||||
static bool viewPgcFromUri(
|
static bool viewPgcFromUri(
|
||||||
String uri, {
|
String uri, {
|
||||||
bool isPgc = true,
|
bool isPgc = true,
|
||||||
String? progress,
|
int? progress, // milliseconds
|
||||||
int? aid,
|
int? aid,
|
||||||
}) {
|
}) {
|
||||||
RegExpMatch? match = _pgcRegex.firstMatch(uri);
|
RegExpMatch? match = _pgcRegex.firstMatch(uri);
|
||||||
@@ -817,7 +817,7 @@ abstract final class PageUtils {
|
|||||||
static Future<void> viewPgc({
|
static Future<void> viewPgc({
|
||||||
dynamic seasonId,
|
dynamic seasonId,
|
||||||
dynamic epId,
|
dynamic epId,
|
||||||
String? progress,
|
int? progress, // milliseconds
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
SmartDialog.showLoading(msg: '资源获取中');
|
SmartDialog.showLoading(msg: '资源获取中');
|
||||||
@@ -837,7 +837,7 @@ abstract final class PageUtils {
|
|||||||
seasonId: response.seasonId,
|
seasonId: response.seasonId,
|
||||||
epId: episode.epId,
|
epId: episode.epId,
|
||||||
cover: episode.cover,
|
cover: episode.cover,
|
||||||
progress: progress == null ? null : int.tryParse(progress),
|
progress: progress,
|
||||||
extraArguments: {
|
extraArguments: {
|
||||||
'pgcApi': true,
|
'pgcApi': true,
|
||||||
'pgcItem': response,
|
'pgcItem': response,
|
||||||
@@ -886,7 +886,7 @@ abstract final class PageUtils {
|
|||||||
epId: episode.epId,
|
epId: episode.epId,
|
||||||
pgcType: response.type,
|
pgcType: response.type,
|
||||||
cover: episode.cover,
|
cover: episode.cover,
|
||||||
progress: progress == null ? null : int.tryParse(progress),
|
progress: progress,
|
||||||
extraArguments: {
|
extraArguments: {
|
||||||
'pgcItem': response,
|
'pgcItem': response,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user