|
@@ -206,6 +206,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
|
|
|
|
|
|
[self unregisterObservers];
|
|
|
[[VLCEventManager sharedManager] cancelCallToObject:self];
|
|
|
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
|
|
|
|
// Always get rid of the delegate first so we can stop sending messages to it
|
|
|
// TODO: Should we tell the delegate that we're shutting down?
|
|
@@ -727,6 +728,8 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
|
|
|
instance = libvlc_media_player_new([VLCLibrary sharedInstance]);
|
|
|
|
|
|
[self registerObservers];
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillResignActive:)
|
|
|
+ name:UIApplicationWillResignActiveNotification object:nil];
|
|
|
|
|
|
[self setDrawable:aDrawable];
|
|
|
}
|
|
@@ -765,6 +768,11 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
|
|
|
libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self);
|
|
|
}
|
|
|
|
|
|
+- (void)applicationWillResignActive:(NSNotification *)notification
|
|
|
+{
|
|
|
+ [self pause];
|
|
|
+}
|
|
|
+
|
|
|
- (void)mediaPlayerTimeChanged:(NSNumber *)newTime
|
|
|
{
|
|
|
[self willChangeValueForKey:@"time"];
|