opt: video play

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-09 12:27:07 +08:00
parent 5da86d85de
commit 17e3a0206a
3 changed files with 16 additions and 1 deletions

View File

@@ -74,7 +74,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
// 播放器状态监听 // 播放器状态监听
void playerListener(PlayerStatus? status) { void playerListener(PlayerStatus? status) {
if (status == PlayerStatus.playing) { if (status == PlayerStatus.playing) {
_controller?.onResume(); _controller?.resume();
} else { } else {
_controller?.pause(); _controller?.pause();
} }
@@ -93,6 +93,10 @@ class _PlDanmakuState extends State<PlDanmaku> {
return; return;
} }
if (playerController.playerStatus.status.value != PlayerStatus.playing) {
return;
}
int currentPosition = position.inMilliseconds; int currentPosition = position.inMilliseconds;
currentPosition -= currentPosition % 100; //取整百的毫秒数 currentPosition -= currentPosition % 100; //取整百的毫秒数
if (currentPosition == latestAddedPosition) { if (currentPosition == latestAddedPosition) {

View File

@@ -1217,6 +1217,9 @@ class VideoDetailController extends GetxController
autoPlay.value = false; autoPlay.value = false;
isShowCover.value = true; isShowCover.value = true;
videoState.value = LoadingState.error('视频资源不存在'); videoState.value = LoadingState.error('视频资源不存在');
if (plPlayerController.isFullScreen.value) {
plPlayerController.toggleFullScreen(false);
}
isQuerying = false; isQuerying = false;
return; return;
} }
@@ -1330,6 +1333,9 @@ class VideoDetailController extends GetxController
autoPlay.value = false; autoPlay.value = false;
isShowCover.value = true; isShowCover.value = true;
videoState.value = LoadingState.error(result['msg']); videoState.value = LoadingState.error(result['msg']);
if (plPlayerController.isFullScreen.value) {
plPlayerController.toggleFullScreen(false);
}
if (result['code'] == -404) { if (result['code'] == -404) {
SmartDialog.showToast('视频不存在或已被删除'); SmartDialog.showToast('视频不存在或已被删除');
} }

View File

@@ -2331,6 +2331,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
required dynamic aid, required dynamic aid,
required bool isSeason, required bool isSeason,
}) { }) {
if (isSeason && videoDetailController.isPlayAll) {
SmartDialog.showToast('当前为播放全部,合集不支持倒序');
return;
}
void changeEpisode(episode) { void changeEpisode(episode) {
videoIntroController.changeSeasonOrbangu( videoIntroController.changeSeasonOrbangu(
episode is bangumi.EpisodeItem ? episode.epId : null, episode is bangumi.EpisodeItem ? episode.epId : null,