mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 16:48:16 +08:00
opt: show video sheet
Closes #761 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -126,6 +126,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
child: MediaQuery.removePadding(
|
child: MediaQuery.removePadding(
|
||||||
context: context,
|
context: context,
|
||||||
removeRight: true,
|
removeRight: true,
|
||||||
|
removeTop: true,
|
||||||
child: _buildList,
|
child: _buildList,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -138,6 +139,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
child: MediaQuery.removePadding(
|
child: MediaQuery.removePadding(
|
||||||
context: context,
|
context: context,
|
||||||
removeLeft: true,
|
removeLeft: true,
|
||||||
|
removeTop: true,
|
||||||
child: switch (_type) {
|
child: switch (_type) {
|
||||||
'privacySetting' => PrivacySetting(showAppBar: false),
|
'privacySetting' => PrivacySetting(showAppBar: false),
|
||||||
'recommendSetting' => RecommendSetting(showAppBar: false),
|
'recommendSetting' => RecommendSetting(showAppBar: false),
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ class VideoDetailController extends GetxController
|
|||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
if (plPlayerController.isFullScreen.value) {
|
if (plPlayerController.isFullScreen.value || showVideoSheet) {
|
||||||
PageUtils.showVideoBottomSheet(
|
PageUtils.showVideoBottomSheet(
|
||||||
context,
|
context,
|
||||||
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
||||||
@@ -445,6 +445,11 @@ class VideoDetailController extends GetxController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool horizontalScreen =
|
||||||
|
GStorage.setting.get(SettingBoxKey.horizontalScreen, defaultValue: false);
|
||||||
|
bool get showVideoSheet =>
|
||||||
|
!horizontalScreen && Get.context!.orientation == Orientation.landscape;
|
||||||
|
|
||||||
int? _lastPos;
|
int? _lastPos;
|
||||||
double? _blockLimit;
|
double? _blockLimit;
|
||||||
List<Pair<SegmentType, SkipType>>? _blockSettings;
|
List<Pair<SegmentType, SkipType>>? _blockSettings;
|
||||||
@@ -1356,7 +1361,7 @@ class VideoDetailController extends GetxController
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (plPlayerController.isFullScreen.value) {
|
if (plPlayerController.isFullScreen.value || showVideoSheet) {
|
||||||
PageUtils.showVideoBottomSheet(
|
PageUtils.showVideoBottomSheet(
|
||||||
context,
|
context,
|
||||||
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
||||||
@@ -1649,7 +1654,7 @@ class VideoDetailController extends GetxController
|
|||||||
title =
|
title =
|
||||||
Get.find<VideoIntroController>(tag: heroTag).videoDetail.value.title;
|
Get.find<VideoIntroController>(tag: heroTag).videoDetail.value.title;
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
if (plPlayerController.isFullScreen.value) {
|
if (plPlayerController.isFullScreen.value || showVideoSheet) {
|
||||||
PageUtils.showVideoBottomSheet(
|
PageUtils.showVideoBottomSheet(
|
||||||
context,
|
context,
|
||||||
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
// 自动退出全屏
|
// 自动退出全屏
|
||||||
late bool autoExitFullscreen;
|
late bool autoExitFullscreen;
|
||||||
late bool autoPlayEnable;
|
late bool autoPlayEnable;
|
||||||
late bool horizontalScreen;
|
|
||||||
late bool enableVerticalExpand;
|
late bool enableVerticalExpand;
|
||||||
late bool autoPiP;
|
late bool autoPiP;
|
||||||
late bool pipNoDanmaku;
|
late bool pipNoDanmaku;
|
||||||
@@ -151,8 +150,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
}
|
}
|
||||||
autoExitFullscreen =
|
autoExitFullscreen =
|
||||||
setting.get(SettingBoxKey.enableAutoExit, defaultValue: true);
|
setting.get(SettingBoxKey.enableAutoExit, defaultValue: true);
|
||||||
horizontalScreen =
|
|
||||||
setting.get(SettingBoxKey.horizontalScreen, defaultValue: false);
|
|
||||||
autoPlayEnable =
|
autoPlayEnable =
|
||||||
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: false);
|
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: false);
|
||||||
autoPiP = setting.get(SettingBoxKey.autoPiP, defaultValue: false);
|
autoPiP = setting.get(SettingBoxKey.autoPiP, defaultValue: false);
|
||||||
@@ -359,7 +356,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
videoIntroController.canelTimer();
|
videoIntroController.canelTimer();
|
||||||
videoIntroController.videoDetail.close();
|
videoIntroController.videoDetail.close();
|
||||||
videoDetailController.cid.close();
|
videoDetailController.cid.close();
|
||||||
if (!horizontalScreen) {
|
if (!videoDetailController.horizontalScreen) {
|
||||||
AutoOrientation.portraitUpMode();
|
AutoOrientation.portraitUpMode();
|
||||||
}
|
}
|
||||||
shutdownTimerService.handleWaitingFinished();
|
shutdownTimerService.handleWaitingFinished();
|
||||||
@@ -648,7 +645,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
final double videoWidth = context.width;
|
final double videoWidth = context.width;
|
||||||
if (MediaQuery.of(context).orientation ==
|
if (MediaQuery.of(context).orientation ==
|
||||||
Orientation.landscape &&
|
Orientation.landscape &&
|
||||||
!horizontalScreen &&
|
!videoDetailController.horizontalScreen &&
|
||||||
!isFullScreen &&
|
!isFullScreen &&
|
||||||
isShowing &&
|
isShowing &&
|
||||||
mounted) {
|
mounted) {
|
||||||
@@ -1454,7 +1451,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
late ThemeData themeData;
|
late ThemeData themeData;
|
||||||
|
|
||||||
Widget get child {
|
Widget get child {
|
||||||
if (!horizontalScreen) {
|
if (!videoDetailController.horizontalScreen) {
|
||||||
return autoChoose(childWhenDisabled);
|
return autoChoose(childWhenDisabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1633,7 +1630,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
Widget videoPlayer(double videoWidth, double videoHeight) {
|
Widget videoPlayer(double videoWidth, double videoHeight) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: !isFullScreen &&
|
canPop: !isFullScreen &&
|
||||||
(horizontalScreen ||
|
(videoDetailController.horizontalScreen ||
|
||||||
MediaQuery.of(context).orientation == Orientation.portrait),
|
MediaQuery.of(context).orientation == Orientation.portrait),
|
||||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@@ -2143,7 +2140,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (isFullScreen) {
|
if (isFullScreen || videoDetailController.showVideoSheet) {
|
||||||
PageUtils.showVideoBottomSheet(
|
PageUtils.showVideoBottomSheet(
|
||||||
context,
|
context,
|
||||||
isFullScreen: () => isFullScreen,
|
isFullScreen: () => isFullScreen,
|
||||||
@@ -2241,7 +2238,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void showViewPoints() {
|
void showViewPoints() {
|
||||||
if (isFullScreen) {
|
if (isFullScreen || videoDetailController.showVideoSheet) {
|
||||||
PageUtils.showVideoBottomSheet(
|
PageUtils.showVideoBottomSheet(
|
||||||
context,
|
context,
|
||||||
isFullScreen: () => isFullScreen,
|
isFullScreen: () => isFullScreen,
|
||||||
@@ -2280,7 +2277,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
plPlayerController!.triggerFullScreen(status: false);
|
plPlayerController!.triggerFullScreen(status: false);
|
||||||
}
|
}
|
||||||
if (MediaQuery.of(context).orientation == Orientation.landscape &&
|
if (MediaQuery.of(context).orientation == Orientation.landscape &&
|
||||||
!horizontalScreen) {
|
!videoDetailController.horizontalScreen) {
|
||||||
verticalScreenForTwoSeconds();
|
verticalScreenForTwoSeconds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user