mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: option shrink video
Closes #410 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -2130,6 +2130,13 @@ List<SettingsModel> get extraSettings => [
|
||||
setKey: SettingBoxKey.showFSActionItem,
|
||||
defaultVal: true,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '启用双指缩小视频',
|
||||
leading: const Icon(Icons.pinch),
|
||||
setKey: SettingBoxKey.enableShrinkVideoSize,
|
||||
defaultVal: true,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
enableFeedback: true,
|
||||
|
||||
@@ -255,6 +255,7 @@ class PlPlayerController {
|
||||
Rx<bool> isOpenDanmu = false.obs;
|
||||
|
||||
late final showFSActionItem = GStorage.showFSActionItem;
|
||||
late final enableShrinkVideoSize = GStorage.enableShrinkVideoSize;
|
||||
|
||||
/// 弹幕权重
|
||||
int danmakuWeight = 0;
|
||||
|
||||
@@ -699,9 +699,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
transformationController: transformationController,
|
||||
panEnabled: false, // 启用平移 //单指平移会与横竖手势冲突
|
||||
scaleEnabled: !plPlayerController.controlsLock.value, // 启用缩放
|
||||
minScale: 0.75,
|
||||
minScale: plPlayerController.enableShrinkVideoSize ? 0.75 : 1,
|
||||
maxScale: 2.0,
|
||||
boundaryMargin: const EdgeInsets.all(double.infinity),
|
||||
boundaryMargin: plPlayerController.enableShrinkVideoSize
|
||||
? const EdgeInsets.all(double.infinity)
|
||||
: EdgeInsets.zero,
|
||||
panAxis: PanAxis.aligned,
|
||||
onInteractionStart: (ScaleStartDetails details) {
|
||||
if (plPlayerController.controlsLock.value) return;
|
||||
|
||||
@@ -397,6 +397,9 @@ class GStorage {
|
||||
static bool get showFSActionItem =>
|
||||
GStorage.setting.get(SettingBoxKey.showFSActionItem, defaultValue: true);
|
||||
|
||||
static bool get enableShrinkVideoSize => GStorage.setting
|
||||
.get(SettingBoxKey.enableShrinkVideoSize, defaultValue: true);
|
||||
|
||||
static List<double> get dynamicDetailRatio => List<double>.from(setting
|
||||
.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]));
|
||||
|
||||
@@ -653,6 +656,7 @@ class SettingBoxKey {
|
||||
enableHttp2 = 'enableHttp2',
|
||||
slideDismissReplyPage = 'slideDismissReplyPage',
|
||||
showFSActionItem = 'showFSActionItem',
|
||||
enableShrinkVideoSize = 'enableShrinkVideoSize',
|
||||
|
||||
// Sponsor Block
|
||||
enableSponsorBlock = 'enableSponsorBlock',
|
||||
|
||||
Reference in New Issue
Block a user