Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-06 12:01:33 +08:00
parent 3fc12fcc09
commit b2c3b1ff95
3 changed files with 11 additions and 2 deletions

View File

@@ -417,6 +417,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
return; return;
} }
if (videoDetailController.plPlayerController.playerStatus.status.value ==
PlayerStatus.playing &&
videoDetailController.playerStatus != PlayerStatus.playing) {
videoDetailController.plPlayerController.pause();
}
isShowing = true; isShowing = true;
PlPlayerController.setPlayCallBack(playCallBack); PlPlayerController.setPlayCallBack(playCallBack);
videoIntroController.startTimer(); videoIntroController.startTimer();

View File

@@ -285,7 +285,7 @@ class PlPlayerController {
// 播放顺序相关 // 播放顺序相关
PlayRepeat playRepeat = PlayRepeat.pause; PlayRepeat playRepeat = PlayRepeat.pause;
final GlobalKey<VideoState> key = GlobalKey<VideoState>(); GlobalKey<VideoState> key = GlobalKey<VideoState>();
TextStyle get subTitleStyle => TextStyle( TextStyle get subTitleStyle => TextStyle(
height: 1.5, height: 1.5,
@@ -1496,7 +1496,9 @@ class PlPlayerController {
if (type == 'single' && playerCount.value > 1) { if (type == 'single' && playerCount.value > 1) {
_playerCount.value -= 1; _playerCount.value -= 1;
_heartDuration = 0; _heartDuration = 0;
pause(); if (!Get.previousRoute.startsWith('/video')) {
pause();
}
return; return;
} }
_playerCount.value = 0; _playerCount.value = 0;

View File

@@ -154,6 +154,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
@override @override
void initState() { void initState() {
super.initState(); super.initState();
plPlayerController.key = GlobalKey<VideoState>();
animationController = AnimationController( animationController = AnimationController(
vsync: this, duration: const Duration(milliseconds: 100)); vsync: this, duration: const Duration(milliseconds: 100));
videoController = plPlayerController.videoController!; videoController = plPlayerController.videoController!;