removed iOS PiP

This commit is contained in:
Schnitzel5 2025-08-07 23:56:27 +02:00
parent fc8cfd75e5
commit 72dd2d7661
8 changed files with 295 additions and 557 deletions

View file

@ -36,7 +36,6 @@
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>audio</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>

View file

@ -520,6 +520,6 @@
"clear_library": "Clear library",
"clear_library_desc": "Choose to clear all manga, anime and/or novel entries",
"clear_library_input": "Type 'manga', 'anime' and/or 'novel' (separated by a comma) to remove all related entries",
"enable_pip": "Enable Picture-in-Picture (PiP)",
"enable_auto_pip": "Enter PiP automatically when moving out of app"
"recommendations": "Recommendations",
"recommendations_similarity": "Similarity:"
}

View file

@ -276,10 +276,6 @@ class Settings {
int? volumeBoostCap;
bool? enablePiP;
bool? enableAutoPiP;
Settings({
this.id = 227,
this.updatedAt = 0,
@ -403,8 +399,6 @@ class Settings {
this.enableAudioPitchCorrection,
this.audioChannels = AudioChannel.autoSafe,
this.volumeBoostCap,
this.enablePiP = true,
this.enableAutoPiP = true,
});
Settings.fromJson(Map<String, dynamic> json) {
@ -636,8 +630,6 @@ class Settings {
audioChannels = AudioChannel
.values[json['audioChannels'] ?? AudioChannel.autoSafe.index];
volumeBoostCap = json['volumeBoostCap'];
enablePiP = json['enablePiP'];
enableAutoPiP = json['enableAutoPiP'];
}
Map<String, dynamic> toJson() => {
@ -784,8 +776,6 @@ class Settings {
'enableAudioPitchCorrection': enableAudioPitchCorrection,
'audioChannels': audioChannels.index,
'volumeBoostCap': volumeBoostCap,
'enablePiP': enablePiP,
'enableAutoPiP': enableAutoPiP,
};
}

File diff suppressed because it is too large Load diff

View file

@ -852,16 +852,6 @@ mp.register_script_message('call_button_${button.id}_long', button${button.id}lo
// Else (if user already watches an episode and just changes it),
// stay in the same mode, the user left it in.
try {
final enablePiP = ref.read(enablePiPStateProvider);
final enableAutoPiP = ref.read(enableAutoPiPStateProvider);
/// only available for iOS 15+
if (enablePiP && _controller.isPictureInPictureAvailable()) {
_controller.enablePictureInPicture();
if (enableAutoPiP) {
_controller.enableAutoPictureInPicture();
}
}
final defaultSkipIntroLength = ref.read(
defaultSkipIntroLengthStateProvider,
);
@ -1954,12 +1944,6 @@ mp.register_script_message('call_button_${button.id}_long', button${button.id}lo
}
},
),
if (_controller.isPictureInPictureAvailable())
IconButton(
onPressed: () async =>
await _controller.enterPictureInPicture(),
icon: const Icon(Icons.featured_video_outlined),
),
],
),
],

View file

@ -20,8 +20,6 @@ class PlayerScreen extends ConsumerStatefulWidget {
class _PlayerScreenState extends ConsumerState<PlayerScreen> {
@override
Widget build(BuildContext context) {
final enablePiP = ref.watch(enablePiPStateProvider);
final enableAutoPiP = ref.watch(enableAutoPiPStateProvider);
final defaultSubtitleLang = ref.watch(defaultSubtitleLangStateProvider);
final markEpisodeAsSeenType = ref.watch(markEpisodeAsSeenTypeStateProvider);
final defaultSkipIntroLength = ref.watch(
@ -42,22 +40,6 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
body: SingleChildScrollView(
child: Column(
children: [
if (Platform.isIOS)
SwitchListTile(
value: enablePiP,
title: Text(context.l10n.enable_pip),
onChanged: (value) {
ref.read(enablePiPStateProvider.notifier).set(value);
},
),
if (Platform.isIOS)
SwitchListTile(
value: enableAutoPiP,
title: Text(context.l10n.enable_auto_pip),
onChanged: (value) {
ref.read(enableAutoPiPStateProvider.notifier).set(value);
},
),
ListTile(
onTap: () {
showDialog(

View file

@ -5,46 +5,6 @@ import 'package:mangayomi/models/settings.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'player_state_provider.g.dart';
@riverpod
class EnablePiPState extends _$EnablePiPState {
@override
bool build() {
return isar.settings.getSync(227)!.enablePiP ?? true;
}
void set(bool value) {
final settings = isar.settings.getSync(227);
state = value;
isar.writeTxnSync(
() => isar.settings.putSync(
settings!
..enablePiP = value
..updatedAt = DateTime.now().millisecondsSinceEpoch,
),
);
}
}
@riverpod
class EnableAutoPiPState extends _$EnableAutoPiPState {
@override
bool build() {
return isar.settings.getSync(227)!.enableAutoPiP ?? true;
}
void set(bool value) {
final settings = isar.settings.getSync(227);
state = value;
isar.writeTxnSync(
() => isar.settings.putSync(
settings!
..enableAutoPiP = value
..updatedAt = DateTime.now().millisecondsSinceEpoch,
),
);
}
}
@riverpod
class DefaultSubtitleLangState extends _$DefaultSubtitleLangState {
@override

View file

@ -6,39 +6,6 @@ part of 'player_state_provider.dart';
// RiverpodGenerator
// **************************************************************************
String _$enablePiPStateHash() => r'e99c6a5dc9d6fe55c6b33b03d2d74e55ae5f4199';
/// See also [EnablePiPState].
@ProviderFor(EnablePiPState)
final enablePiPStateProvider =
AutoDisposeNotifierProvider<EnablePiPState, bool>.internal(
EnablePiPState.new,
name: r'enablePiPStateProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$enablePiPStateHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$EnablePiPState = AutoDisposeNotifier<bool>;
String _$enableAutoPiPStateHash() =>
r'5d0e53cccb9be4cedb8567ce1cd7b5fe3ff2e52f';
/// See also [EnableAutoPiPState].
@ProviderFor(EnableAutoPiPState)
final enableAutoPiPStateProvider =
AutoDisposeNotifierProvider<EnableAutoPiPState, bool>.internal(
EnableAutoPiPState.new,
name: r'enableAutoPiPStateProvider',
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
? null
: _$enableAutoPiPStateHash,
dependencies: null,
allTransitiveDependencies: null,
);
typedef _$EnableAutoPiPState = AutoDisposeNotifier<bool>;
String _$defaultSubtitleLangStateHash() =>
r'ae7b275e168dd15117512d9ed1c474736458753b';