mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-18 09:36:52 +08:00
set system brightness
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -143,7 +143,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
void dispose() {
|
||||
videoPlayerServiceHandler?.onVideoDetailDispose(heroTag);
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
if (Utils.isMobile) {
|
||||
if (Platform.isAndroid && !plPlayerController.setSystemBrightness) {
|
||||
ScreenBrightnessPlatform.instance.resetApplicationScreenBrightness();
|
||||
}
|
||||
PlPlayerController.setPlayCallBack(null);
|
||||
|
||||
@@ -82,6 +82,14 @@ List<SettingsModel> get playSettings => [
|
||||
setKey: SettingBoxKey.enableSlideVolumeBrightness,
|
||||
defaultVal: true,
|
||||
),
|
||||
if (Platform.isAndroid)
|
||||
const SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '调节系统亮度',
|
||||
leading: Icon(Icons.brightness_6_outlined),
|
||||
setKey: SettingBoxKey.setSystemBrightness,
|
||||
defaultVal: false,
|
||||
),
|
||||
const SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '中间滑动进入/退出全屏',
|
||||
|
||||
@@ -110,6 +110,7 @@ class VideoDetailController extends GetxController
|
||||
|
||||
PlPlayerController plPlayerController = PlPlayerController.getInstance()
|
||||
..setCurrBrightness(-1.0);
|
||||
bool get setSystemBrightness => plPlayerController.setSystemBrightness;
|
||||
|
||||
late VideoItem firstVideo;
|
||||
late AudioItem firstAudio;
|
||||
|
||||
@@ -326,7 +326,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
);
|
||||
|
||||
if (!Get.previousRoute.startsWith('/video')) {
|
||||
if (Utils.isMobile) {
|
||||
if (Platform.isAndroid && !videoDetailController.setSystemBrightness) {
|
||||
ScreenBrightnessPlatform.instance.resetApplicationScreenBrightness();
|
||||
}
|
||||
PlPlayerController.setPlayCallBack(null);
|
||||
@@ -371,7 +371,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
|
||||
if (Utils.isMobile) {
|
||||
if (Platform.isAndroid && !videoDetailController.setSystemBrightness) {
|
||||
ScreenBrightnessPlatform.instance.resetApplicationScreenBrightness();
|
||||
}
|
||||
|
||||
@@ -418,7 +418,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
|
||||
introController.startTimer();
|
||||
|
||||
if (Utils.isMobile && mounted) {
|
||||
if (mounted &&
|
||||
Platform.isAndroid &&
|
||||
!videoDetailController.setSystemBrightness) {
|
||||
if (videoDetailController.brightness != null) {
|
||||
plPlayerController?.setCurrBrightness(
|
||||
videoDetailController.brightness!,
|
||||
|
||||
Reference in New Issue
Block a user