playerViewController(_:willResumePlaybackAfterUserNavigatedFrom:to:)
Tells the delegate when the user navigates to a new time and playback is about to begin.
Declaration
optional func playerViewController(_ playerViewController: AVPlayerViewController, willResumePlaybackAfterUserNavigatedFrom oldTime: CMTime, to targetTime: CMTime)Parameters
- playerViewController:
The player view controller.
- oldTime:
The current playback time before the user began navigating.
- targetTime:
The new time where playback is about to resume.
Discussion
Unlike the timeJumpedNotification notification, this method fires only for complete, user-initiated navigation events. For example, if the user begins scrubbing through the media timeline and pauses several times before resuming playback, the player view controller calls this method only once.
You can use this method to present interstitial content before resuming playback, however, it’s recommended to use playerViewController(_:timeToSeekAfterUserNavigatedFrom:to:) for this purpose.