mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 16:48:43 +00:00
increase desktop max volume
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -59,7 +59,10 @@ class PlayerFocus extends StatelessWidget {
|
|||||||
|
|
||||||
void _setVolume({required bool isIncrease}) {
|
void _setVolume({required bool isIncrease}) {
|
||||||
final volume = isIncrease
|
final volume = isIncrease
|
||||||
? math.min(1.0, plPlayerController.volume.value + 0.1)
|
? math.min(
|
||||||
|
PlPlayerController.maxVolume,
|
||||||
|
plPlayerController.volume.value + 0.1,
|
||||||
|
)
|
||||||
: math.max(0.0, plPlayerController.volume.value - 0.1);
|
: math.max(0.0, plPlayerController.volume.value - 0.1);
|
||||||
plPlayerController.setVolume(volume);
|
plPlayerController.setVolume(volume);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1336,6 +1336,7 @@ class PlPlayerController {
|
|||||||
Timer? volumeTimer;
|
Timer? volumeTimer;
|
||||||
final RxBool volumeInterceptEventStream = false.obs;
|
final RxBool volumeInterceptEventStream = false.obs;
|
||||||
|
|
||||||
|
static final double maxVolume = PlatformUtils.isDesktop ? 2.0 : 1.0;
|
||||||
Future<void> setVolume(double volume) async {
|
Future<void> setVolume(double volume) async {
|
||||||
if (this.volume.value != volume) {
|
if (this.volume.value != volume) {
|
||||||
this.volume.value = volume;
|
this.volume.value = volume;
|
||||||
|
|||||||
@@ -1116,7 +1116,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
final double volume = clampDouble(
|
final double volume = clampDouble(
|
||||||
plPlayerController.volume.value - delta.dy / level,
|
plPlayerController.volume.value - delta.dy / level,
|
||||||
0.0,
|
0.0,
|
||||||
1.0,
|
PlPlayerController.maxVolume,
|
||||||
);
|
);
|
||||||
plPlayerController.setVolume(volume);
|
plPlayerController.setVolume(volume);
|
||||||
},
|
},
|
||||||
@@ -1340,7 +1340,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
final double volume = clampDouble(
|
final double volume = clampDouble(
|
||||||
plPlayerController.volume.value - event.localPanDelta.dy / level,
|
plPlayerController.volume.value - event.localPanDelta.dy / level,
|
||||||
0.0,
|
0.0,
|
||||||
1.0,
|
PlPlayerController.maxVolume,
|
||||||
);
|
);
|
||||||
plPlayerController.setVolume(volume);
|
plPlayerController.setVolume(volume);
|
||||||
},
|
},
|
||||||
@@ -1358,7 +1358,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
final volume = clampDouble(
|
final volume = clampDouble(
|
||||||
plPlayerController.volume.value + offset,
|
plPlayerController.volume.value + offset,
|
||||||
0.0,
|
0.0,
|
||||||
1.0,
|
PlPlayerController.maxVolume,
|
||||||
);
|
);
|
||||||
plPlayerController.setVolume(volume);
|
plPlayerController.setVolume(volume);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user