Skip to content
Snippets Groups Projects

AppDelegate: save playback position on termination if playback is active

Merged Felix Paul Kühne requested to merge fkuehne/vlc-ios:save-on-termination into master
1 file
+ 11
1
Compare changes
  • Side-by-side
  • Inline
@@ -2,7 +2,7 @@
* VLCAppDelegate.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013-2022 VideoLAN. All rights reserved.
* Copyright (c) 2013-2023 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
@@ -229,6 +229,16 @@
}
}
- (void)applicationWillTerminate:(UIApplication *)application
{
/* save the playback position before the user kills the app */
VLCPlaybackService *vps = [VLCPlaybackService sharedInstance];
if (vps.isPlaying || vps.playerIsSetup) {
VLCAppCoordinator *appCoordinator = [VLCAppCoordinator sharedInstance];
[appCoordinator.mediaLibraryService savePlaybackStateFrom:vps];
}
}
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler
{
[[VLCAppCoordinator sharedInstance] handleShortcutItem:shortcutItem];
Loading