opt auto fullscreen

opt video fit

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-04 14:22:51 +08:00
parent 8d312d8cf1
commit a802bc1cdf
7 changed files with 47 additions and 85 deletions

View File

@@ -657,13 +657,13 @@ class VideoDetailController extends GetxController
playerInit();
}
Future<void>? _initPlayerIfNeeded() {
Future<void>? _initPlayerIfNeeded(bool autoFullScreenFlag) {
if (_autoPlay.value ||
(plPlayerController.preInitPlayer && !plPlayerController.processing) &&
(isFileSource
? true
: videoPlayerKey.currentState?.mounted == true)) {
return playerInit();
return playerInit(autoFullScreenFlag: autoFullScreenFlag);
}
return null;
}
@@ -675,6 +675,7 @@ class VideoDetailController extends GetxController
Duration? duration,
bool? autoplay,
Volume? volume,
bool autoFullScreenFlag = false,
}) async {
Duration? seek = seekToTime ?? defaultST ?? playedTime;
if (seek == null || seek == Duration.zero) {
@@ -715,6 +716,7 @@ class VideoDetailController extends GetxController
width: firstVideo.width,
height: firstVideo.height,
volume: volume ?? this.volume,
autoFullScreenFlag: autoFullScreenFlag,
);
if (isClosed) return;
@@ -756,9 +758,10 @@ class VideoDetailController extends GetxController
Future<void> queryVideoUrl({
Duration? defaultST,
bool fromReset = false,
bool autoFullScreenFlag = false,
}) async {
if (isFileSource) {
return _initPlayerIfNeeded();
return _initPlayerIfNeeded(autoFullScreenFlag);
}
if (isQuerying) {
return;
@@ -832,7 +835,7 @@ class VideoDetailController extends GetxController
setVideoHeight();
currentDecodeFormats = VideoDecodeFormatType.fromString('avc1');
currentVideoQa.value = videoQuality;
await _initPlayerIfNeeded();
await _initPlayerIfNeeded(autoFullScreenFlag);
isQuerying = false;
return;
}
@@ -931,7 +934,7 @@ class VideoDetailController extends GetxController
} else {
audioUrl = '';
}
await _initPlayerIfNeeded();
await _initPlayerIfNeeded(autoFullScreenFlag);
} else {
_autoPlay.value = false;
videoState.value = result..toast();