Browse Source

playback: push fullscreen video screen if the user starts playback of a media with a video track

Felix Paul Kühne 10 years ago
parent
commit
ad781be771
1 changed files with 7 additions and 2 deletions
  1. 7 2
      Sources/VLCPlaybackController.m

+ 7 - 2
Sources/VLCPlaybackController.m

@@ -48,6 +48,7 @@
     BOOL _mediaIsAudioOnly;
 
     BOOL _needsMetadataUpdate;
+    BOOL _mediaWasJustStarted;
 }
 
 @end
@@ -307,18 +308,19 @@
         _mediaPlayer.position = lastPosition;
 
     [self subscribeRemoteCommands];
+
     [[(VLCAppDelegate *)[UIApplication sharedApplication].delegate playlistViewController] displayMiniPlaybackViewIfNeeded];
 
     _playerIsSetup = YES;
+    _mediaWasJustStarted = YES;
 }
 
 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
 {
     if (buttonIndex == 1)
         [self _playNewMedia];
-    else {
+    else
         [self stopPlayback];
-    }
 }
 
 - (void)stopPlayback
@@ -795,6 +797,9 @@
 
         if (title.length < 1)
             title = [[_mediaPlayer.media url] lastPathComponent];
+    } else if (_mediaWasJustStarted) {
+        _mediaWasJustStarted = NO;
+        [(VLCAppDelegate *)[UIApplication sharedApplication].delegate presentMovieViewController];
     }
 
     /* populate delegate with metadata info */