From b289a51990b197f34b42c8c60c57f7b49892a775 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 18 May 2024 19:29:57 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20playInit=20autoplay=20=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/controller.dart | 4 ++-- lib/pages/video/detail/view.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 2425c06e..954da393 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -371,7 +371,7 @@ class VideoDetailController extends GetxController audio, seekToTime, duration, - bool autoplay = true, + bool? autoplay, }) async { await plPlayerController.setDataSource( DataSource( @@ -400,7 +400,7 @@ class VideoDetailController extends GetxController bvid: bvid, cid: cid.value, enableHeart: enableHeart, - autoplay: autoplay, + autoplay: autoplay ?? autoPlay.value, ); _initSkip(); diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 34ae1977..cdb4c85c 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -244,7 +244,7 @@ class _VideoDetailPageState extends State } plPlayerController = videoDetailController.plPlayerController; videoDetailController.isShowCover.value = false; - await videoDetailController.playerInit(); + await videoDetailController.playerInit(autoplay: true); plPlayerController!.addStatusLister(playerListener); await plPlayerController!.autoEnterFullscreen(); videoDetailController.autoPlay.value = true; @@ -354,7 +354,7 @@ class _VideoDetailPageState extends State videoDetailController.autoPlay.value = !videoDetailController.isShowCover.value; if (videoDetailController.videoUrl != null) { - await videoDetailController.playerInit(autoplay: autoplay); + await videoDetailController.playerInit(); } if (videoDetailController.playerStatus == PlayerStatus.playing) {