浏览代码

VLCMediaPlayer: don't pause playback if the iOS app is going to the background, since this behavior may be different per client application

Felix Paul Kühne 12 年之前
父节点
当前提交
f9dad8786c
共有 3 个文件被更改,包括 0 次插入36 次删除
  1. 0 1
      Headers/Public/VLCMediaPlayer.h
  2. 0 2
      NEWS
  3. 0 33
      Sources/VLCMediaPlayer.m

+ 0 - 1
Headers/Public/VLCMediaPlayer.h

@@ -96,7 +96,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
     float position;                     //< The position of the media being played
     id drawable;                        //< The drawable associated to this media player
     VLCAudio *audio;
-    BOOL shouldResumePlaying;           //< resume playing on iOS
 }
 
 #if !TARGET_OS_IPHONE

+ 0 - 2
NEWS

@@ -50,8 +50,6 @@ Modified behavior:
 MobileVLCKit features:
 - added support for Opus
 - slimmed binary by removing dysfunctional or irrelevant modules
-- playback is paused if client app resigns active state
-- playback resumes if client app is being active again
 - idle state and screen sleep is prevented during playback
 
 Removed APIs:

+ 0 - 33
Sources/VLCMediaPlayer.m

@@ -199,9 +199,6 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
 
     [self unregisterObservers];
     [[VLCEventManager sharedManager] cancelCallToObject:self];
-#if TARGET_OS_IPHONE
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
-#endif
 
     // 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?
@@ -952,15 +949,6 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
         instance = libvlc_media_player_new([VLCLibrary sharedInstance]);
 
         [self registerObservers];
-#if TARGET_OS_IPHONE
-        NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
-        [center addObserver:self selector:@selector(applicationWillResignActive:)
-                       name:UIApplicationWillResignActiveNotification object:nil];
-        [center addObserver:self selector:@selector(applicationDidBecomeActive:)
-                       name:UIApplicationDidBecomeActiveNotification object:nil];
-        [center addObserver:self selector:@selector(applicationDidEnterBackground:)
-                       name:UIApplicationDidEnterBackgroundNotification object:nil];
-#endif
 
         [self setDrawable:aDrawable];
     }
@@ -999,27 +987,6 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
     libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged,     HandleMediaPlayerMediaChanged,   self);
 }
 
-#if TARGET_OS_IPHONE
-- (void)applicationWillResignActive:(NSNotification *)notification
-{
-    shouldResumePlaying = YES;
-    [self pause];
-}
-
-- (void)applicationDidEnterBackground:(NSNotification *)notification
-{
-    shouldResumePlaying = NO;
-}
-
-- (void)applicationDidBecomeActive:(NSNotification *)notification
-{
-    if (shouldResumePlaying) {
-        shouldResumePlaying = NO;
-        [self play];
-    }
-}
-#endif
-
 - (void)mediaPlayerTimeChanged:(NSNumber *)newTime
 {
     [self willChangeValueForKey:@"time"];