Hi,
I'm presenting an AVPlayerViewController from another ViewController, I'd like to get a callback when the Done button is touched.
According to the documentation:
"Do not subclass
AVPlayerViewController
. Overriding this class’s methods is unsupported and results in undefined behavior."So I cannot trigger a custom notification on ViewWillDisappear, I also tried with AVPlayerItemDidPlayToEndTimeNotification:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:videoPlayer.player];
I remember that on the now deprecated MPMoviePlayerController there was
MPMoviePlayerPlaybackDidFinishNotification for that.
Is there a way to get a callback from a generic presented view when it's dismissed ?
Or something more specific for AVPlayerViewController ?
Maybe KVO on something in the inner AVPlayer ?
Thanks