mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
mod: fullscreen debounce
Closes #340 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1370,7 +1370,9 @@ class PlPlayerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 全屏
|
// 全屏
|
||||||
Future<void> triggerFullScreen({bool status = true}) async {
|
void triggerFullScreen({bool status = true, int duration = 500}) {
|
||||||
|
EasyThrottle.throttle('fullScreen', Duration(milliseconds: duration),
|
||||||
|
() async {
|
||||||
stopScreenTimer();
|
stopScreenTimer();
|
||||||
FullScreenMode mode = FullScreenModeCode.fromCode(
|
FullScreenMode mode = FullScreenModeCode.fromCode(
|
||||||
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
setting.get(SettingBoxKey.fullScreenMode, defaultValue: 0))!;
|
||||||
@@ -1413,6 +1415,7 @@ class PlPlayerController {
|
|||||||
await autoScreen();
|
await autoScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void addPositionListener(Function(Duration position) listener) =>
|
void addPositionListener(Function(Duration position) listener) =>
|
||||||
|
|||||||
@@ -629,8 +629,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
size: 24,
|
size: 24,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
fuc: () =>
|
fuc: () => plPlayerController.triggerFullScreen(
|
||||||
plPlayerController.triggerFullScreen(status: !isFullScreen),
|
status: !isFullScreen, duration: 800),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -842,11 +842,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
details.localFocalPoint.dy - _initialFocalPoint.dy;
|
details.localFocalPoint.dy - _initialFocalPoint.dy;
|
||||||
|
|
||||||
void fullScreenTrigger(bool status) {
|
void fullScreenTrigger(bool status) {
|
||||||
EasyThrottle.throttle(
|
plPlayerController.triggerFullScreen(
|
||||||
'fullScreen', const Duration(milliseconds: 800),
|
status: status, duration: 800);
|
||||||
() async {
|
|
||||||
await plPlayerController.triggerFullScreen(status: status);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cumulativeDy > threshold) {
|
if (cumulativeDy > threshold) {
|
||||||
@@ -1170,12 +1167,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
details.localPosition.dy - _initialFocalPoint.dy;
|
details.localPosition.dy - _initialFocalPoint.dy;
|
||||||
|
|
||||||
void fullScreenTrigger(bool status) {
|
void fullScreenTrigger(bool status) {
|
||||||
EasyThrottle.throttle(
|
plPlayerController.triggerFullScreen(status: status);
|
||||||
'fullScreen', const Duration(milliseconds: 800),
|
|
||||||
() async {
|
|
||||||
await plPlayerController.triggerFullScreen(
|
|
||||||
status: status);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cumulativeDy > threshold) {
|
if (cumulativeDy > threshold) {
|
||||||
|
|||||||
Reference in New Issue
Block a user