Explorar o código

VLCPlaybackController: The delegate is not always a UIViewController instead use the topmost controller

Carola Nitz %!s(int64=7) %!d(string=hai) anos
pai
achega
f71180b520
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      Sources/VLCPlaybackController.m

+ 4 - 1
Sources/VLCPlaybackController.m

@@ -1195,10 +1195,13 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
                                                                                                                              [self setPlaybackPosition:lastPosition];
                                                                                                                          }]
                                                              ];
+                UIViewController *presentingVC = [UIApplication sharedApplication].delegate.window.rootViewController;
+                presentingVC = presentingVC.presentedViewController ?: presentingVC;
                 [VLCAlertViewController alertViewManagerWithTitle:NSLocalizedString(@"CONTINUE_PLAYBACK", nil)
                                                      errorMessage:[NSString stringWithFormat:NSLocalizedString(@"CONTINUE_PLAYBACK_LONG", nil), item.title]
-                                                   viewController:self.delegate
+                                                   viewController:presentingVC
                                                     buttonsAction:buttonsAction];
+
             }
         }
     }