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) {
if (status == PlayerStatus.playing) {
_controller?.onResume();
_controller?.resume();
} else {
_controller?.pause();
}
@@ -93,6 +93,10 @@ class _PlDanmakuState extends State<PlDanmaku> {
return;
}
if (playerController.playerStatus.status.value != PlayerStatus.playing) {
return;
}
int currentPosition = position.inMilliseconds;
currentPosition -= currentPosition % 100; //取整百的毫秒数
if (currentPosition == latestAddedPosition) {

View File

@@ -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('视频不存在或已被删除');
}

View File

@@ -2331,6 +2331,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
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,