Strange media player overlay main screen

Respected Madam/Sir,

The following code works well in the past year, but when I test it again on my iPhone which run iOS 16.7.8, a strange media player appeared and overlay the main screen of my app, I really don't know what happened there, I'm struggling to resolve it hours, but it still always appear, help please!

Any suggestion, direction, api misused, would be appreciated.

let mainScreenController : ViewController = ViewController()

self.window = UIWindow(frame: UIScreen.main.bounds)

self.window?.rootViewController = mainScreenController

self.window?.makeKeyAndVisible()

The app does not use storyboard, actual code in product:

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    UIWindow *window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];

    mainMenuViewController = [[MainMenuViewController alloc] init];

    navigationController = [[UINavigationController alloc] initWithRootViewController: mainMenuViewController];

    window.rootViewController = navigationController;

    self.window = window;

    [self.window makeKeyAndVisible];

    return YES;

}

Resolved.

In the app, all UI elements was created manually and all ViewController inherited from a BaseViewController, including MainMenuViewController.

a. the code caused the issue: @interface BaseViewController: AVPlayerViewController

b. modified code: @interface BaseViewController: UIViewController

Why the base ViewController inherited from AVPlayerViewController, because there's a VideoViewController that will be used to play video. unfortunately, OC don't support multiple inheritance, so I have to embed the base ViewController's functions into VideoViewController instead of inheritance. It's an issue caused by not being careful enough when modifying code.

Strange media player overlay main screen
 
 
Q