mod: show volume when hiding sysui for ios

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-01 12:35:18 +08:00
parent e1805896f4
commit bd91fb7c6d

View File

@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'package:PiliPlus/common/widgets/segment_progress_bar.dart';
@@ -175,6 +176,15 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
FlutterVolumeController.addListener((double value) {
if (mounted && !_volumeInterceptEventStream.value) {
_volumeValue.value = value;
if (Platform.isIOS && FlutterVolumeController.showSystemUI.not) {
_volumeIndicator.value = true;
_volumeTimer?.cancel();
_volumeTimer = Timer(const Duration(milliseconds: 800), () {
if (mounted) {
_volumeIndicator.value = false;
}
});
}
}
});
} catch (_) {}