Focus update crashes UI on tvOS 15.0

I'm encountering UI update issues whenever I'm selecting an option for new quality from the menu in new tvOS 15.0 controls.

FYI: selecting a quality makes a new content node and replaces previous node in player.

However the behaviour is different for two cases

  1. whenever I select an option while content is PLAYING - focus update is okay and and i get the expected outcome.
  2. whenever I select an option while content is ON PAUSE - focus update crashes ui and it moves to previously opened screen while im hearing player playing somewhere in the back

WHEN PLAYING

The focus debug just before focus update shows:

  • AVPlayerViewController.view.preferredFocusEnvironments:

a. _AVPlayerViewControllerContainerView (skipping collectionView)

<_AVPlayerViewControllerContainerView: 0x7fa0d27f5b30; frame = (0 0; 1920 1080); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x600000f7de90>; layer = <CALayer: 0x6000000df8a0>> (view controller is <AVPlayerViewController: 0x7fa0d31f4a00>

b. container's preferred focusEnvironments:

<_AVFocusContainerView: 0x7fa0c68a4c30; frame = (0 0; 1920 1080); gestureRecognizers = <NSArray: 0x600000f68e40>; layer = <CALayer: 0x6000000d79a0>> (view controller is <AVPlayerViewController: 0x7fa0d31f4a00>)

WHEN IN PAUSE

The focus debug just before focus update in this case shows: a. CollectionView - the customMenuItems collectionView

<UICollectionView: 0x7fa0d3143800; frame = (0 844; 1920 64); autoresize = W+H; gestureRecognizers = <NSArray: 0x600000f43300>; layer = <CALayer: 0x6000000dccc0>; contentOffset: {0, 0}; contentSize: {1760, 64}; adjustedContentInset: {0, 0, 0, 0}; layout: <AVxCollectionViewLayout: 0x7fa0d2760580>; dataSource: <AVxCollectionViewController: 0x7fa0c6873e00>>

b. CollectionView.preferredFocusEnvironments is cell - is one of customMenuItems

<AVxOverlayToolCell: 0x7fa0dd721140; baseClass = UICollectionViewCell; frame = (1606 0; 64 64); layer = <CALayer: 0x60000012b980>>

c. Cell's preferredFocusEnvironments is empty.

I don't know if its native bug or there's a way to solve this myself.

What's the crashing thread's backtrace?

Focus update crashes UI on tvOS 15.0
 
 
Q