mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-03-11 17:25:32 +00:00
testing iOS Picture-in-Picture
implementation from [PR #206](https://github.com/media-kit/media-kit/pull/206)
This commit is contained in:
parent
bb1ba2f3bb
commit
20c943e5fc
26 changed files with 738 additions and 360 deletions
|
|
@ -36,6 +36,7 @@
|
|||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>fetch</string>
|
||||
<string>audio</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@
|
|||
"today": "Today",
|
||||
"yesterday": "Yesterday",
|
||||
"a_week_ago": "A week ago",
|
||||
"next_week": "Next week",
|
||||
"add_to_library": "Add to library",
|
||||
"completed": "Completed",
|
||||
"ongoing": "Ongoing",
|
||||
|
|
@ -518,5 +519,7 @@
|
|||
"in_n_days": "in {days} days",
|
||||
"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"
|
||||
"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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -945,6 +945,12 @@ abstract class AppLocalizations {
|
|||
/// **'A week ago'**
|
||||
String get a_week_ago;
|
||||
|
||||
/// No description provided for @next_week.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Next week'**
|
||||
String get next_week;
|
||||
|
||||
/// No description provided for @add_to_library.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
|
|
@ -3188,6 +3194,18 @@ abstract class AppLocalizations {
|
|||
/// In en, this message translates to:
|
||||
/// **'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries'**
|
||||
String get clear_library_input;
|
||||
|
||||
/// No description provided for @enable_pip.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enable Picture-in-Picture (PiP)'**
|
||||
String get enable_pip;
|
||||
|
||||
/// No description provided for @enable_auto_pip.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Enter PiP automatically when moving out of app'**
|
||||
String get enable_auto_pip;
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
|
|
|||
|
|
@ -441,6 +441,9 @@ class AppLocalizationsAr extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'منذ أسبوع';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'إضافة إلى المكتبة';
|
||||
|
||||
|
|
@ -1648,4 +1651,11 @@ class AppLocalizationsAr extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -443,6 +443,9 @@ class AppLocalizationsAs extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'এসপ্তাহৰ আগতে';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'পুথিভঁৰালত যোগ কৰক';
|
||||
|
||||
|
|
@ -1650,4 +1653,11 @@ class AppLocalizationsAs extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -445,6 +445,9 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'Vor einer Woche';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Zur Bibliothek hinzufügen';
|
||||
|
||||
|
|
@ -1661,4 +1664,11 @@ class AppLocalizationsDe extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -443,6 +443,9 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'A week ago';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Add to library';
|
||||
|
||||
|
|
@ -1649,4 +1652,11 @@ class AppLocalizationsEn extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -447,6 +447,9 @@ class AppLocalizationsEs extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'Hace una semana';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Agregar a la biblioteca';
|
||||
|
||||
|
|
@ -1666,6 +1669,13 @@ class AppLocalizationsEs extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
||||
/// The translations for Spanish Castilian, as used in Latin America and the Caribbean (`es_419`).
|
||||
|
|
|
|||
|
|
@ -449,6 +449,9 @@ class AppLocalizationsFr extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'Il y a une semaine';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Ajouter à la bibliothèque';
|
||||
|
||||
|
|
@ -1667,4 +1670,11 @@ class AppLocalizationsFr extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -443,6 +443,9 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'एक सप्ताह पहले';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'पुस्तकालय में जोड़ें';
|
||||
|
||||
|
|
@ -1651,4 +1654,11 @@ class AppLocalizationsHi extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -447,6 +447,9 @@ class AppLocalizationsId extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'Seminggu yang Lalu';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Tambahkan ke Perpustakaan';
|
||||
|
||||
|
|
@ -1655,4 +1658,11 @@ class AppLocalizationsId extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -447,6 +447,9 @@ class AppLocalizationsIt extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'Una settimana fa';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Aggiungi alla biblioteca';
|
||||
|
||||
|
|
@ -1664,4 +1667,11 @@ class AppLocalizationsIt extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -447,6 +447,9 @@ class AppLocalizationsPt extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'Uma semana atrás';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Adicionar à biblioteca';
|
||||
|
||||
|
|
@ -1663,6 +1666,13 @@ class AppLocalizationsPt extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
||||
/// The translations for Portuguese, as used in Brazil (`pt_BR`).
|
||||
|
|
|
|||
|
|
@ -448,6 +448,9 @@ class AppLocalizationsRu extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'Неделю назад';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Добавить в библиотеку';
|
||||
|
||||
|
|
@ -1665,4 +1668,11 @@ class AppLocalizationsRu extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -443,6 +443,9 @@ class AppLocalizationsTh extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'สัปดาห์ที่แล้ว';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'เพิ่มไปที่ชั้นหนังสือ';
|
||||
|
||||
|
|
@ -1649,4 +1652,11 @@ class AppLocalizationsTh extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -443,6 +443,9 @@ class AppLocalizationsTr extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => 'Bir Hafta Önce';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => 'Kütüphaneye Ekle';
|
||||
|
||||
|
|
@ -1655,4 +1658,11 @@ class AppLocalizationsTr extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -435,6 +435,9 @@ class AppLocalizationsZh extends AppLocalizations {
|
|||
@override
|
||||
String get a_week_ago => '一周前';
|
||||
|
||||
@override
|
||||
String get next_week => 'Next week';
|
||||
|
||||
@override
|
||||
String get add_to_library => '添加到图书馆';
|
||||
|
||||
|
|
@ -1620,4 +1623,11 @@ class AppLocalizationsZh extends AppLocalizations {
|
|||
@override
|
||||
String get clear_library_input =>
|
||||
'Type \'manga\', \'anime\' and/or \'novel\' (separated by a comma) to remove all related entries';
|
||||
|
||||
@override
|
||||
String get enable_pip => 'Enable Picture-in-Picture (PiP)';
|
||||
|
||||
@override
|
||||
String get enable_auto_pip =>
|
||||
'Enter PiP automatically when moving out of app';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,6 +276,10 @@ class Settings {
|
|||
|
||||
int? volumeBoostCap;
|
||||
|
||||
bool? enablePiP;
|
||||
|
||||
bool? enableAutoPiP;
|
||||
|
||||
Settings({
|
||||
this.id = 227,
|
||||
this.updatedAt = 0,
|
||||
|
|
@ -399,6 +403,8 @@ class Settings {
|
|||
this.enableAudioPitchCorrection,
|
||||
this.audioChannels = AudioChannel.autoSafe,
|
||||
this.volumeBoostCap,
|
||||
this.enablePiP = true,
|
||||
this.enableAutoPiP = true,
|
||||
});
|
||||
|
||||
Settings.fromJson(Map<String, dynamic> json) {
|
||||
|
|
@ -630,6 +636,8 @@ class Settings {
|
|||
audioChannels = AudioChannel
|
||||
.values[json['audioChannels'] ?? AudioChannel.autoSafe.index];
|
||||
volumeBoostCap = json['volumeBoostCap'];
|
||||
enablePiP = json['enablePiP'];
|
||||
enableAutoPiP = json['enableAutoPiP'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
|
@ -776,6 +784,8 @@ class Settings {
|
|||
'enableAudioPitchCorrection': enableAudioPitchCorrection,
|
||||
'audioChannels': audioChannels.index,
|
||||
'volumeBoostCap': volumeBoostCap,
|
||||
'enablePiP': enablePiP,
|
||||
'enableAutoPiP': enableAutoPiP,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -852,6 +852,16 @@ 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,
|
||||
);
|
||||
|
|
@ -1944,53 +1954,12 @@ mp.register_script_message('call_button_${button.id}_long', button${button.id}lo
|
|||
}
|
||||
},
|
||||
),
|
||||
// IconButton(
|
||||
// onPressed: () {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return AlertDialog(
|
||||
// scrollable: true,
|
||||
// title: Text("Player Settings"),
|
||||
// content: SizedBox(
|
||||
// width: context.width(0.8),
|
||||
// child: Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// SwitchListTile(
|
||||
// value: false,
|
||||
// title: Text(
|
||||
// "Enable Volume and Brightness Gestures",
|
||||
// style: TextStyle(
|
||||
// color: Theme.of(context)
|
||||
// .textTheme
|
||||
// .bodyLarge!
|
||||
// .color!
|
||||
// .withValues(alpha: 0.9),
|
||||
// fontSize: 14),
|
||||
// ),
|
||||
// onChanged: (value) {}),
|
||||
// SwitchListTile(
|
||||
// value: false,
|
||||
// title: Text(
|
||||
// "Enable Horizonal Seek Gestures",
|
||||
// style: TextStyle(
|
||||
// color: Theme.of(context)
|
||||
// .textTheme
|
||||
// .bodyLarge!
|
||||
// .color!
|
||||
// .withValues(alpha: 0.9),
|
||||
// fontSize: 14),
|
||||
// ),
|
||||
// onChanged: (value) {}),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// });
|
||||
// },
|
||||
// icon: Icon(Icons.adaptive.more))
|
||||
if (_controller.isPictureInPictureAvailable())
|
||||
IconButton(
|
||||
onPressed: () async =>
|
||||
await _controller.enterPictureInPicture(),
|
||||
icon: const Icon(Icons.featured_video_outlined),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class _DoRestoreProviderElement extends AutoDisposeProviderElement<void>
|
|||
BuildContext get context => (origin as DoRestoreProvider).context;
|
||||
}
|
||||
|
||||
String _$restoreBackupHash() => r'0dc4d911f0b84fd7fa30acf690799b196db4de6e';
|
||||
String _$restoreBackupHash() => r'adc705e1e65dedcc919a525d7bd14f6451620c43';
|
||||
|
||||
/// See also [restoreBackup].
|
||||
@ProviderFor(restoreBackup)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:mangayomi/modules/more/settings/player/providers/player_state_provider.dart';
|
||||
|
|
@ -18,6 +20,8 @@ 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(
|
||||
|
|
@ -38,6 +42,22 @@ 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(
|
||||
|
|
|
|||
|
|
@ -5,6 +5,46 @@ 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
|
||||
|
|
|
|||
|
|
@ -6,6 +6,39 @@ 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';
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ String dateFormat(
|
|||
showInDaysFuture
|
||||
? l10n.in_n_days(difference)
|
||||
: l10n.n_days_ago(difference),
|
||||
_ => l10n.a_week_ago,
|
||||
_ => showInDaysFuture ? l10n.next_week : l10n.a_week_ago,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
16
pubspec.lock
16
pubspec.lock
|
|
@ -1164,7 +1164,7 @@ packages:
|
|||
description:
|
||||
path: media_kit
|
||||
ref: HEAD
|
||||
resolved-ref: "085be0ec40a95f351b2f3c11c0ff017d4e0a1498"
|
||||
resolved-ref: f26da7cc3725e109c63e1300639df00cd65992a3
|
||||
url: "https://github.com/Schnitzel5/media-kit.git"
|
||||
source: git
|
||||
version: "1.2.0"
|
||||
|
|
@ -1173,7 +1173,7 @@ packages:
|
|||
description:
|
||||
path: "libs/android/media_kit_libs_android_video"
|
||||
ref: HEAD
|
||||
resolved-ref: "085be0ec40a95f351b2f3c11c0ff017d4e0a1498"
|
||||
resolved-ref: f26da7cc3725e109c63e1300639df00cd65992a3
|
||||
url: "https://github.com/Schnitzel5/media-kit.git"
|
||||
source: git
|
||||
version: "1.3.7"
|
||||
|
|
@ -1182,7 +1182,7 @@ packages:
|
|||
description:
|
||||
path: "libs/ios/media_kit_libs_ios_video"
|
||||
ref: HEAD
|
||||
resolved-ref: "085be0ec40a95f351b2f3c11c0ff017d4e0a1498"
|
||||
resolved-ref: f26da7cc3725e109c63e1300639df00cd65992a3
|
||||
url: "https://github.com/Schnitzel5/media-kit.git"
|
||||
source: git
|
||||
version: "1.1.4"
|
||||
|
|
@ -1191,7 +1191,7 @@ packages:
|
|||
description:
|
||||
path: "libs/linux/media_kit_libs_linux"
|
||||
ref: HEAD
|
||||
resolved-ref: "085be0ec40a95f351b2f3c11c0ff017d4e0a1498"
|
||||
resolved-ref: f26da7cc3725e109c63e1300639df00cd65992a3
|
||||
url: "https://github.com/Schnitzel5/media-kit.git"
|
||||
source: git
|
||||
version: "1.2.1"
|
||||
|
|
@ -1200,7 +1200,7 @@ packages:
|
|||
description:
|
||||
path: "libs/macos/media_kit_libs_macos_video"
|
||||
ref: HEAD
|
||||
resolved-ref: "085be0ec40a95f351b2f3c11c0ff017d4e0a1498"
|
||||
resolved-ref: f26da7cc3725e109c63e1300639df00cd65992a3
|
||||
url: "https://github.com/Schnitzel5/media-kit.git"
|
||||
source: git
|
||||
version: "1.1.4"
|
||||
|
|
@ -1209,7 +1209,7 @@ packages:
|
|||
description:
|
||||
path: "libs/universal/media_kit_libs_video"
|
||||
ref: HEAD
|
||||
resolved-ref: "085be0ec40a95f351b2f3c11c0ff017d4e0a1498"
|
||||
resolved-ref: f26da7cc3725e109c63e1300639df00cd65992a3
|
||||
url: "https://github.com/Schnitzel5/media-kit.git"
|
||||
source: git
|
||||
version: "1.0.6"
|
||||
|
|
@ -1218,7 +1218,7 @@ packages:
|
|||
description:
|
||||
path: "libs/windows/media_kit_libs_windows_video"
|
||||
ref: HEAD
|
||||
resolved-ref: "085be0ec40a95f351b2f3c11c0ff017d4e0a1498"
|
||||
resolved-ref: f26da7cc3725e109c63e1300639df00cd65992a3
|
||||
url: "https://github.com/Schnitzel5/media-kit.git"
|
||||
source: git
|
||||
version: "1.0.11"
|
||||
|
|
@ -1227,7 +1227,7 @@ packages:
|
|||
description:
|
||||
path: media_kit_video
|
||||
ref: HEAD
|
||||
resolved-ref: "085be0ec40a95f351b2f3c11c0ff017d4e0a1498"
|
||||
resolved-ref: f26da7cc3725e109c63e1300639df00cd65992a3
|
||||
url: "https://github.com/Schnitzel5/media-kit.git"
|
||||
source: git
|
||||
version: "1.3.0"
|
||||
|
|
|
|||
Loading…
Reference in a new issue