mod: page observer

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-14 11:15:50 +08:00
parent 7dd47736fb
commit 064c8a9dfe
3 changed files with 13 additions and 2 deletions

View File

@@ -1003,7 +1003,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
case 1:
final List<InlineSpan> spanChildren = <InlineSpan>[];
final RegExp urlRegExp = RegExp(
'${Constants.urlPattern}|av\\d+|bv\\S+\\b',
'${Constants.urlPattern}|av\\d+|bv[a-z\\d]{10}',
caseSensitive: false,
);
@@ -1030,7 +1030,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
} catch (e) {
spanChildren.add(TextSpan(text: matchStr));
}
} else if (RegExp(r'^bv\S+\b$', caseSensitive: false)
} else if (RegExp(r'^bv[a-z\d]{10}$', caseSensitive: false)
.hasMatch(matchStr)) {
try {
// validate

View File

@@ -393,6 +393,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
return;
}
WidgetsBinding.instance.removeObserver(this);
ScreenBrightness().resetApplicationScreenBrightness();
videoDetailController.positionSubscription?.cancel();
@@ -426,6 +428,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
return;
}
WidgetsBinding.instance.addObserver(this);
if (videoDetailController.plPlayerController.playerStatus.status.value ==
PlayerStatus.playing &&
videoDetailController.playerStatus != PlayerStatus.playing) {