feature: Added settings to force the player into certain orientations (#108)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-11-02 18:44:18 +01:00 committed by GitHub
parent 691293648b
commit c32f71b368
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 170 additions and 5 deletions

View file

@ -16,6 +16,9 @@ _$VideoPlayerSettingsModelImpl _$$VideoPlayerSettingsModelImplFromJson(
hardwareAccel: json['hardwareAccel'] as bool? ?? true,
useLibass: json['useLibass'] as bool? ?? false,
internalVolume: (json['internalVolume'] as num?)?.toDouble() ?? 100,
allowedOrientations: (json['allowedOrientations'] as List<dynamic>?)
?.map((e) => $enumDecode(_$DeviceOrientationEnumMap, e))
.toSet(),
nextVideoType:
$enumDecodeNullable(_$AutoNextTypeEnumMap, json['nextVideoType']) ??
AutoNextType.static,
@ -31,6 +34,9 @@ Map<String, dynamic> _$$VideoPlayerSettingsModelImplToJson(
'hardwareAccel': instance.hardwareAccel,
'useLibass': instance.useLibass,
'internalVolume': instance.internalVolume,
'allowedOrientations': instance.allowedOrientations
?.map((e) => _$DeviceOrientationEnumMap[e]!)
.toList(),
'nextVideoType': _$AutoNextTypeEnumMap[instance.nextVideoType]!,
'audioDevice': instance.audioDevice,
};
@ -45,6 +51,13 @@ const _$BoxFitEnumMap = {
BoxFit.scaleDown: 'scaleDown',
};
const _$DeviceOrientationEnumMap = {
DeviceOrientation.portraitUp: 'portraitUp',
DeviceOrientation.landscapeLeft: 'landscapeLeft',
DeviceOrientation.portraitDown: 'portraitDown',
DeviceOrientation.landscapeRight: 'landscapeRight',
};
const _$AutoNextTypeEnumMap = {
AutoNextType.off: 'off',
AutoNextType.smart: 'smart',