瀏覽代碼

Bail-out on playback error

Felix Paul Kühne 12 年之前
父節點
當前提交
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];
 }

二進制
Resources/de.lproj/Localizable.strings


二進制
Resources/en.lproj/Localizable.strings


二進制
Resources/fr.lproj/Localizable.strings