mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 11:22:16 +08:00
@@ -102,8 +102,6 @@ class VideoDetailController extends GetxController
|
||||
late VideoDecodeFormatType currentDecodeFormats;
|
||||
// 是否开始自动播放 存在多p的情况下,第二p需要为true
|
||||
final RxBool autoPlay = true.obs;
|
||||
// 封面图的展示
|
||||
final RxBool isShowCover = true.obs;
|
||||
|
||||
final scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
final childKey = GlobalKey<ScaffoldState>();
|
||||
@@ -285,7 +283,6 @@ class VideoDetailController extends GetxController
|
||||
);
|
||||
|
||||
autoPlay.value = Pref.autoPlayEnable;
|
||||
if (autoPlay.value) isShowCover.value = false;
|
||||
|
||||
// 预设的解码格式
|
||||
cacheDecode = Pref.defaultDecode;
|
||||
@@ -732,7 +729,7 @@ class VideoDetailController extends GetxController
|
||||
);
|
||||
|
||||
if (positionSubscription == null &&
|
||||
!isShowCover.value &&
|
||||
autoPlay.value &&
|
||||
plPlayerController.videoPlayerController != null) {
|
||||
final currPost =
|
||||
plPlayerController.position.value.inMilliseconds;
|
||||
@@ -781,7 +778,7 @@ class VideoDetailController extends GetxController
|
||||
);
|
||||
|
||||
if (positionSubscription == null &&
|
||||
(!isShowCover.value || plPlayerController.preInitPlayer)) {
|
||||
(autoPlay.value || plPlayerController.preInitPlayer)) {
|
||||
initSkip();
|
||||
plPlayerController.segmentList.value = segmentProgressList!;
|
||||
}
|
||||
@@ -799,7 +796,7 @@ class VideoDetailController extends GetxController
|
||||
?.stream
|
||||
.position
|
||||
.listen((position) {
|
||||
if (isShowCover.value) {
|
||||
if (!autoPlay.value) {
|
||||
return;
|
||||
}
|
||||
int currentPos = position.inSeconds;
|
||||
@@ -1000,7 +997,7 @@ class VideoDetailController extends GetxController
|
||||
|
||||
/// 更新画质、音质
|
||||
void updatePlayer() {
|
||||
isShowCover.value = false;
|
||||
autoPlay.value = true;
|
||||
playedTime = plPlayerController.position.value;
|
||||
plPlayerController.removeListeners();
|
||||
plPlayerController.isBuffering.value = false;
|
||||
@@ -1209,10 +1206,7 @@ class VideoDetailController extends GetxController
|
||||
setVideoHeight();
|
||||
currentDecodeFormats = VideoDecodeFormatTypeExt.fromString('avc1')!;
|
||||
currentVideoQa = VideoQuality.fromCode(data.quality!);
|
||||
if (autoPlay.value) {
|
||||
isShowCover.value = false;
|
||||
await playerInit();
|
||||
} else if (plPlayerController.preInitPlayer) {
|
||||
if (autoPlay.value || plPlayerController.preInitPlayer) {
|
||||
await playerInit();
|
||||
}
|
||||
isQuerying = false;
|
||||
@@ -1221,7 +1215,6 @@ class VideoDetailController extends GetxController
|
||||
if (data.dash == null) {
|
||||
SmartDialog.showToast('视频资源不存在');
|
||||
autoPlay.value = false;
|
||||
isShowCover.value = true;
|
||||
videoState.value = const Error('视频资源不存在');
|
||||
if (plPlayerController.isFullScreen.value) {
|
||||
plPlayerController.toggleFullScreen(false);
|
||||
@@ -1340,15 +1333,11 @@ class VideoDetailController extends GetxController
|
||||
? Duration.zero
|
||||
: Duration(milliseconds: data.lastPlayTime!));
|
||||
}
|
||||
if (autoPlay.value) {
|
||||
isShowCover.value = false;
|
||||
await playerInit();
|
||||
} else if (plPlayerController.preInitPlayer) {
|
||||
if (autoPlay.value || plPlayerController.preInitPlayer) {
|
||||
await playerInit();
|
||||
}
|
||||
} else {
|
||||
autoPlay.value = false;
|
||||
isShowCover.value = true;
|
||||
videoState.value = Error(result['msg']);
|
||||
if (plPlayerController.isFullScreen.value) {
|
||||
plPlayerController.toggleFullScreen(false);
|
||||
|
||||
Reference in New Issue
Block a user