From 17e3a0206a4feee79bb8f48fe31888562328132e Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Wed, 9 Apr 2025 12:27:07 +0800 Subject: [PATCH] opt: video play Signed-off-by: bggRGjQaUbCoE --- lib/pages/danmaku/view.dart | 6 +++++- lib/pages/video/detail/controller.dart | 6 ++++++ lib/pages/video/detail/view_v.dart | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/pages/danmaku/view.dart b/lib/pages/danmaku/view.dart index e851d855..ccafab49 100644 --- a/lib/pages/danmaku/view.dart +++ b/lib/pages/danmaku/view.dart @@ -74,7 +74,7 @@ class _PlDanmakuState extends State { // 播放器状态监听 void playerListener(PlayerStatus? status) { if (status == PlayerStatus.playing) { - _controller?.onResume(); + _controller?.resume(); } else { _controller?.pause(); } @@ -93,6 +93,10 @@ class _PlDanmakuState extends State { return; } + if (playerController.playerStatus.status.value != PlayerStatus.playing) { + return; + } + int currentPosition = position.inMilliseconds; currentPosition -= currentPosition % 100; //取整百的毫秒数 if (currentPosition == latestAddedPosition) { diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 9d6b4e71..97234258 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -1217,6 +1217,9 @@ class VideoDetailController extends GetxController autoPlay.value = false; isShowCover.value = true; videoState.value = LoadingState.error('视频资源不存在'); + if (plPlayerController.isFullScreen.value) { + plPlayerController.toggleFullScreen(false); + } isQuerying = false; return; } @@ -1330,6 +1333,9 @@ class VideoDetailController extends GetxController autoPlay.value = false; isShowCover.value = true; videoState.value = LoadingState.error(result['msg']); + if (plPlayerController.isFullScreen.value) { + plPlayerController.toggleFullScreen(false); + } if (result['code'] == -404) { SmartDialog.showToast('视频不存在或已被删除'); } diff --git a/lib/pages/video/detail/view_v.dart b/lib/pages/video/detail/view_v.dart index 26374b50..972d515f 100644 --- a/lib/pages/video/detail/view_v.dart +++ b/lib/pages/video/detail/view_v.dart @@ -2331,6 +2331,11 @@ class _VideoDetailPageVState extends State required dynamic aid, required bool isSeason, }) { + if (isSeason && videoDetailController.isPlayAll) { + SmartDialog.showToast('当前为播放全部,合集不支持倒序'); + return; + } + void changeEpisode(episode) { videoIntroController.changeSeasonOrbangu( episode is bangumi.EpisodeItem ? episode.epId : null,