Browse Source

ATV fullscreen playback: fix logic error preventing closing the VC once playback stops

(cherry picked from commit 38270e3c5a9c5529610929b656550b37d6424ce3)
Felix Paul Kühne 9 years ago
parent
commit
9e1b1b7b48
1 changed files with 7 additions and 4 deletions
  1. 7 4
      Apple-TV/Playback/VLCFullscreenMovieTVViewController.m

+ 7 - 4
Apple-TV/Playback/VLCFullscreenMovieTVViewController.m

@@ -59,9 +59,13 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
 
     NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
     [center addObserver:self
-               selector:@selector(playbackDidStop:)
+               selector:@selector(playbackDidStop)
                    name:VLCPlaybackControllerPlaybackDidStop
                  object:nil];
+    [center addObserver:self
+               selector:@selector(playbackDidStop)
+                   name:VLCPlaybackControllerPlaybackDidFail
+                 object:nil];
 
     _movieView.userInteractionEnabled = NO;
 
@@ -154,8 +158,6 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
     [vpc recoverDisplayedMetadata];
     vpc.videoOutputView = nil;
     vpc.videoOutputView = self.movieView;
-
-    [[NSNotificationCenter defaultCenter] removeObserver:self];
 }
 
 - (void)viewWillDisappear:(BOOL)animated
@@ -177,6 +179,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
         [fileManager removeItemAtPath:tempSubsDirPath error:nil];
 
     [super viewWillDisappear:animated];
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
 }
 
 - (BOOL)canBecomeFirstResponder
@@ -666,7 +669,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
     self.audioView.hidden = YES;
 }
 
-- (void)playbackDidStop:(NSNotification *)aNotification
+- (void)playbackDidStop
 {
     [self dismissViewControllerAnimated:YES completion:nil];
 }