mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-10 03:57:49 +08:00
opt auto fullscreen
opt video fit Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user