Follow the instructions below:
1) First add float *time to the appDelegate.h file.
2) Take the current time in applicationWillResignActive
3) Add below methods
applicationWillResignActive player pause and save player current time
- (void)applicationWillResignActive:(UIApplication *)application { [player pause]; time = player.currentTime }
Now in applicationDidBecomeActive add seekToTime
- (void)applicationDidBecomeActive:(UIApplication *)application { [player seekToTime:time toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero]; [player play]; }
source share