#737 keep playing slideshow when losing focus but app is still visible (e.g. split screen)
This commit is contained in:
parent
b57253c251
commit
694c5941cb
2 changed files with 8 additions and 2 deletions
|
@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
|
|||
### Changed
|
||||
|
||||
- Info: strip `unlocated` filter from context collection when editing location via map
|
||||
- Slideshow: keep playing when losing focus but app is still visible (e.g. split screen)
|
||||
|
||||
## <a id="v1.10.2"></a>[v1.10.2] - 2023-12-24
|
||||
|
||||
|
|
|
@ -290,19 +290,24 @@ class _EntryViewerStackState extends State<EntryViewerStack> with EntryViewContr
|
|||
void _onAppLifecycleStateChanged() {
|
||||
switch (AvesApp.lifecycleStateNotifier.value) {
|
||||
case AppLifecycleState.inactive:
|
||||
// inactive: when losing focus
|
||||
_onAppInactive();
|
||||
case AppLifecycleState.hidden:
|
||||
case AppLifecycleState.paused:
|
||||
case AppLifecycleState.detached:
|
||||
// paused: when switching to another app
|
||||
// detached: when app is without a view
|
||||
viewerController.autopilot = false;
|
||||
pauseVideoControllers();
|
||||
case AppLifecycleState.resumed:
|
||||
availability.onResume();
|
||||
case AppLifecycleState.hidden:
|
||||
// hidden: transient state between `inactive` and `paused`
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _onAppInactive() async {
|
||||
final playingController = context.read<VideoConductor>().getPlayingController();
|
||||
viewerController.autopilot = false;
|
||||
bool enabledPip = false;
|
||||
if (settings.videoBackgroundMode == VideoBackgroundMode.pip) {
|
||||
enabledPip |= await _enablePictureInPicture();
|
||||
|
|
Loading…
Reference in a new issue