Custom Info View Controller index

617 Views Asked by At

Is it possible to change Custom Info View Controller's index in AVPlayerViewController?

customInfoViewController

A view controller that provides client-specific content and controls alongside system-provided information and settings panels. SDK

tvOS 11.0+

Declaration Swift

var customInfoViewController: UIViewController? { get set }

Declaration Objective-C

@property(nonatomic) UIViewController *customInfoViewController;

Let's take a look inside of AVPlayerViewController.h

...

/*!
    @property   customInfoViewController
    @abstract   A view controller to be displayed alongside system-provided info and settings panels.
    @discussion Use this property to provide client-specific content and controls in an additional info view. Implement -preferredContentSize to provide the desired view size.
 */

@property (nonatomic, nullable) UIViewController *customInfoViewController API_AVAILABLE(tvos(11.0));

...

By default, it's the second item at info panel (after info tab). I want to show at first index.

2

There are 2 best solutions below

0
On

For now it's not possible. Maybe in future releases of tvos.

0
On

tvOS 15.0

In AVPlayerViewController it is possible to set order of customInfoViewControllers by ading them into Array in desired order as following: customInfoViewControllers = [viewController1, viewController2]. However if you also have Info controller presented (by setting item metadata) , the Info controller is displayer always as first and customInfoViewControllers are only appended next to it by the order you defined in array. The only solution for you might be just completely disabling Info controller by not setting item metadata and setting just customInfoViewControllers alone.