Pārlūkot izejas kodu

Fix runtime exception

Felix Paul Kühne 9 gadi atpakaļ
vecāks
revīzija
9efd33efa1
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      Sources/VLCPlayerDisplayController.m

+ 4 - 0
Sources/VLCPlayerDisplayController.m

@@ -248,6 +248,10 @@ static NSString *const VLCPlayerDisplayControllerDisplayModeKey = @"VLCPlayerDis
 
 - (void)_presentFullscreenPlaybackViewIfNeeded
 {
+    if (![NSThread isMainThread]) {
+        [self performSelectorOnMainThread:@selector(_presentFullscreenPlaybackViewIfNeeded) withObject:nil waitUntilDone:NO];
+        return;
+    }
     if (!self.movieViewController.presentingViewController) {
         [self _presentMovieViewControllerAnimated:[self shouldAnimate]];
     }