Explorar o código

Bail-out on playback error

Felix Paul Kühne %!s(int64=12) %!d(string=hai) anos
pai
achega
bddfdc98b4

+ 7 - 1
AspenProject/VLCMovieViewController.m

@@ -297,7 +297,13 @@
 
 - (void)mediaPlayerStateChanged:(NSNotification *)aNotification
 {
-    // TODO
+    VLCMediaPlayerState currentState = _mediaPlayer.state;
+
+    if (currentState == VLCMediaPlayerStateError) {
+        [self.statusLabel showStatusMessage:NSLocalizedString(@"PLAYBACK_FAILED", @"")];
+        [self performSelector:@selector(dismiss:) withObject:nil afterDelay:2.];
+    }
+
     UIImage *playPauseImage = [_mediaPlayer isPlaying]? [UIImage imageNamed:@"pause"] : [UIImage imageNamed:@"play"];
     [_playPauseButton setImage:playPauseImage forState:UIControlStateNormal];
 }

BIN=BIN
Resources/de.lproj/Localizable.strings


BIN=BIN
Resources/en.lproj/Localizable.strings


BIN=BIN
Resources/fr.lproj/Localizable.strings