Skip to content

Commit

Permalink
mod: 移除冗余额外横屏功能
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Feb 27, 2024
1 parent cbefe30 commit 11c2a69
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
9 changes: 0 additions & 9 deletions lib/pages/setting/play_setting.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class _PlaySettingState extends State<PlaySetting> {
late dynamic defaultAudioQa;
late dynamic defaultDecode;
late int defaultFullScreenMode;
late bool lockLandscape;
late int defaultBtmProgressBehavior;

@override
Expand All @@ -40,8 +39,6 @@ class _PlaySettingState extends State<PlaySetting> {
defaultValue: VideoDecodeFormats.values.last.code);
defaultFullScreenMode = setting.get(SettingBoxKey.fullScreenMode,
defaultValue: FullScreenMode.values.first.code);
lockLandscape = setting.get(SettingBoxKey.lockLandscape,
defaultValue: false);
defaultBtmProgressBehavior = setting.get(SettingBoxKey.btmProgressBehavior,
defaultValue: BtmProgresBehavior.values.first.code);
}
Expand Down Expand Up @@ -136,12 +133,6 @@ class _PlaySettingState extends State<PlaySetting> {
}
}
),
const SetSwitchItem(
title: '额外横屏',
subTitle: '执行播放器横屏前,额外施加屏幕旋转方向限制',
setKey: SettingBoxKey.lockLandscape,
defaultVal: false,
),
const SetSwitchItem(
title: '开启硬解',
subTitle: '以较低功耗播放视频',
Expand Down
11 changes: 0 additions & 11 deletions lib/plugin/pl_player/utils/fullscreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,13 @@ import 'package:auto_orientation/auto_orientation.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import '../../../common/widgets/custom_toast.dart';
import '../../../utils/storage.dart';

//横屏
Future<void> landScape() async {
dynamic document;
try {
if (kIsWeb) {
await document.documentElement?.requestFullscreen();
} else if (Platform.isAndroid || Platform.isIOS) {
if (setting.get(SettingBoxKey.lockLandscape, defaultValue: false)) {
await SystemChrome.setPreferredOrientations(
[
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
],
);
}
await AutoOrientation.landscapeAutoMode(forceSensor: true);
} else if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) {
await const MethodChannel('com.alexmercerind/media_kit_video')
Expand Down
1 change: 0 additions & 1 deletion lib/utils/storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class SettingBoxKey {
defaultAudioQa = 'defaultAudioQa',
autoPlayEnable = 'autoPlayEnable',
fullScreenMode = 'fullScreenMode',
lockLandscape = 'lockLandscape',
defaultDecode = 'defaultDecode',
danmakuEnable = 'danmakuEnable',
defaultToastOp = 'defaultToastOp',
Expand Down

0 comments on commit 11c2a69

Please sign in to comment.