I have an app with a Kaltura video player, that switches to full-screen mode when the device rotates to landscape. Basically, the app's main VC has a container view that holds a tableview and a view for the video player, and I call this:
[self.containerView addSubview:playerViewController.view];
in my "viewDidAppear" method to add the player. When the devices switches to landscape mode, I call this:
[[[UIApplication sharedApplication] delegate].window addSubview:playerViewController.view];
to get the player to be on the entire screen, and when the device switches back to portrait mode, I call this again:
[self.containerView addSubview:playerViewController.view];
This works fine, but this also hides the app's navigation bar when the device is in landscape (probably because the player is added over it).
I would like to show the navigation bar when the device is in landscape mode as well, but for some reason the line of code I use when the devices switches to landscape mode is the only one that actually puts the player on the entire screen and rotates it sideways.
Is there any way for me to re-add the navigation bar over the player? Or perhaps make it a part of the application window so it won't hide under the player to begin with? If you need me to add any more explanations or code, just tell me. Thanks!!
SOLVED!!! see accepted answer
SOLVED!!!
I ended up creating a "resize player" method that just sets new width and height parameters for the player's view. That way I don't need to re-add the subview every time the device changes its orientation, and the navigation bar is seen in landscape mode as well.
Thanks everyone!! :)