mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: video key
ref orz12/main Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -105,6 +105,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
|
|
||||||
Box get setting => GStorage.setting;
|
Box get setting => GStorage.setting;
|
||||||
|
|
||||||
|
final GlobalKey relatedVideoPanelKey = GlobalKey();
|
||||||
|
final GlobalKey videoPlayerKey = GlobalKey();
|
||||||
|
final GlobalKey videoReplyPanelKey = GlobalKey();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@@ -863,7 +867,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
CustomScrollView(
|
CustomScrollView(
|
||||||
controller: _introController,
|
controller: _introController,
|
||||||
slivers: [
|
slivers: [
|
||||||
RelatedVideoPanel(heroTag: heroTag),
|
RelatedVideoPanel(
|
||||||
|
key: relatedVideoPanelKey,
|
||||||
|
heroTag: heroTag),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (videoDetailController.showReply)
|
if (videoDetailController.showReply)
|
||||||
@@ -950,6 +956,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
() => !videoDetailController.autoPlay.value
|
() => !videoDetailController.autoPlay.value
|
||||||
? const SizedBox()
|
? const SizedBox()
|
||||||
: PLVideoPlayer(
|
: PLVideoPlayer(
|
||||||
|
key: Key(heroTag),
|
||||||
plPlayerController: plPlayerController!,
|
plPlayerController: plPlayerController!,
|
||||||
videoIntroController:
|
videoIntroController:
|
||||||
videoDetailController.videoType == SearchType.video
|
videoDetailController.videoType == SearchType.video
|
||||||
@@ -1081,12 +1088,14 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
);
|
);
|
||||||
|
|
||||||
Widget get plPlayer => Obx(
|
Widget get plPlayer => Obx(
|
||||||
|
key: videoPlayerKey,
|
||||||
() => videoDetailController.videoState.value is! Success
|
() => videoDetailController.videoState.value is! Success
|
||||||
? const SizedBox.shrink()
|
? const SizedBox.shrink()
|
||||||
: !videoDetailController.autoPlay.value ||
|
: !videoDetailController.autoPlay.value ||
|
||||||
plPlayerController?.videoController == null
|
plPlayerController?.videoController == null
|
||||||
? const SizedBox.shrink()
|
? const SizedBox.shrink()
|
||||||
: PLVideoPlayer(
|
: PLVideoPlayer(
|
||||||
|
key: Key(heroTag),
|
||||||
plPlayerController: plPlayerController!,
|
plPlayerController: plPlayerController!,
|
||||||
videoIntroController:
|
videoIntroController:
|
||||||
videoDetailController.videoType == SearchType.video
|
videoDetailController.videoType == SearchType.video
|
||||||
@@ -1411,6 +1420,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
|
|
||||||
Widget videoIntro([bool needRelated = true]) {
|
Widget videoIntro([bool needRelated = true]) {
|
||||||
Widget introPanel() => CustomScrollView(
|
Widget introPanel() => CustomScrollView(
|
||||||
|
key: const PageStorageKey<String>('简介'),
|
||||||
controller: needRelated ? _introController : null,
|
controller: needRelated ? _introController : null,
|
||||||
slivers: [
|
slivers: [
|
||||||
if (videoDetailController.videoType == SearchType.video) ...[
|
if (videoDetailController.videoType == SearchType.video) ...[
|
||||||
@@ -1433,7 +1443,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
RelatedVideoPanel(heroTag: heroTag),
|
RelatedVideoPanel(key: relatedVideoPanelKey, heroTag: heroTag),
|
||||||
] else
|
] else
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@@ -1610,6 +1620,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
|
|
||||||
Widget get videoReplyPanel => Obx(
|
Widget get videoReplyPanel => Obx(
|
||||||
() => VideoReplyPanel(
|
() => VideoReplyPanel(
|
||||||
|
key: videoReplyPanelKey,
|
||||||
bvid: videoDetailController.bvid,
|
bvid: videoDetailController.bvid,
|
||||||
oid: videoDetailController.oid.value,
|
oid: videoDetailController.oid.value,
|
||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
|
|||||||
Reference in New Issue
Block a user