diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index f7b0c7e2..6a1735b5 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -278,8 +278,7 @@ class PlPlayerController { danmakuDurationVal = localCache.get(LocalCacheKey.danmakuDuration, defaultValue: 4.0); // 描边粗细 - strokeWidth = - localCache.get(LocalCacheKey.strokeWidth, defaultValue: 1.5); + strokeWidth = localCache.get(LocalCacheKey.strokeWidth, defaultValue: 1.5); playRepeat = PlayRepeat.values.toList().firstWhere( (e) => e.value == @@ -952,7 +951,10 @@ class PlPlayerController { /// 进入全屏 await enterFullScreen(); if (mode == FullScreenMode.vertical || - (mode == FullScreenMode.auto && direction.value == 'vertical')) { + (mode == FullScreenMode.auto && direction.value == 'vertical') || + (mode == FullScreenMode.ratio && + (Get.height / Get.width < 1.25 || + direction.value == 'vertical'))) { await verticalScreen(); } else { await landScape(); diff --git a/lib/plugin/pl_player/models/fullscreen_mode.dart b/lib/plugin/pl_player/models/fullscreen_mode.dart index 9b5028e7..de5503bb 100644 --- a/lib/plugin/pl_player/models/fullscreen_mode.dart +++ b/lib/plugin/pl_player/models/fullscreen_mode.dart @@ -5,15 +5,17 @@ enum FullScreenMode { // 始终竖屏 vertical, // 始终横屏 - horizontal + horizontal, + // 屏幕长宽比<1.25或为竖屏视频时竖屏,否则横屏 + ratio, } extension FullScreenModeDesc on FullScreenMode { - String get description => ['自适应', '始终竖屏', '始终横屏'][index]; + String get description => ['按视频方向(默认)', '强制竖屏', '强制横屏', '屏幕长宽比<1.25或为竖屏视频时竖屏,否则横屏'][index]; } extension FullScreenModeCode on FullScreenMode { - static final List _codeList = [0, 1, 2]; + static final List _codeList = [0, 1, 2, 3]; int get code => _codeList[index]; static FullScreenMode? fromCode(int code) {