mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-20 01:10:11 +08:00
custom player/max volume
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
final _regExp = RegExp("^(http:)?//", caseSensitive: false);
|
||||
|
||||
extension StringExt on String? {
|
||||
extension NullableStringExt on String? {
|
||||
String get http2https => this?.replaceFirst(_regExp, "https://") ?? '';
|
||||
|
||||
bool get isNullOrEmpty => this == null || this!.isEmpty;
|
||||
}
|
||||
|
||||
extension StringExt on String {
|
||||
String subLength(int length) {
|
||||
if (this.length < length) return this;
|
||||
return substring(0, length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ abstract final class SettingBoxKey {
|
||||
keyboardControl = 'keyboardControl',
|
||||
pgcSkipType = 'pgcSkipType',
|
||||
audioPlayMode = 'audioPlayMode',
|
||||
showBatteryLevel = 'showBatteryLevel';
|
||||
showBatteryLevel = 'showBatteryLevel',
|
||||
playerVolume = 'playerVolume',
|
||||
maxVolume = 'maxVolume';
|
||||
|
||||
static const String horizontalScreen = 'horizontalScreen',
|
||||
CDNService = 'CDNService',
|
||||
|
||||
@@ -521,4 +521,10 @@ abstract final class Pref {
|
||||
|
||||
static int get angleDegrees =>
|
||||
_setting.get(SettingBoxKey.angleDegrees, defaultValue: 30);
|
||||
|
||||
static double get playerVolume => // mobile
|
||||
_setting.get(SettingBoxKey.playerVolume, defaultValue: 100.0);
|
||||
|
||||
static double get maxVolume => // desktop
|
||||
_setting.get(SettingBoxKey.maxVolume, defaultValue: 2.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user