瀏覽代碼

ATV fullscreen playback: prevent corner-case which was lead to a black screen instead of video

(cherry picked from commit a7af6cd13108d9ccf0e635f443d53724a3efe230)
Felix Paul Kühne 9 年之前
父節點
當前提交
846398a54e
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      Apple-TV/Playback/VLCFullscreenMovieTVViewController.m

+ 5 - 0
Apple-TV/Playback/VLCFullscreenMovieTVViewController.m

@@ -684,6 +684,11 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
     [self updateActivityIndicatorForState:currentState];
 
     if (controller.isPlaying) {
+        // we sometimes don't set the vout correctly if playback stops and restarts without dismising and redisplaying the VC
+        // hence, manually reset the vout container here if it doesn't have sufficient children
+        if (self.movieView.subviews.count < 2) {
+            controller.videoOutputView = self.movieView;
+        }
         [self hidePlaybackControlsIfNeededAfterDelay];
     } else {
         [self showPlaybackControlsIfNeededForUserInteraction];