AVPlayer not playing

I'm experiencing an issue with AVPlayer on tvOS 10: it won't start playing a video. On tvOS 9.2 it works as expected (tested on devices too).

I get the same results with using AVPlayerViewController as with AVPlayerLayer: the video seems to be loaded (first frame is visible), and when using the AVPlayerViewController showing playback controls it shows the timeline with correct video length, but though my player's state is .ReadyToPlay (checked before calling play() ), it simply doesn't start. No error is logged, notifications such as AVPlayerItemPlaybackStalledNotification or AVPlayerItemFailedToPlayToEndTimeNotification are not sent.

I didn't find any API change that might be relevant. Since apparently no issue of this nature has been reported yet on the internet, I'm under the impression that I must be doing something wrong, instead of this being a beta-issue.


Just for completeness, using the AVPlayerLayer:

player = AVPlayer(playerItem: playerItem)
playerLayer = AVPlayerLayer(player: player)
playerLayer?.frame = view.bounds
view.layer.addSublayer(playerLayer!)


Thanks for any answer.

I am a step closer towards an answer. The main thread appears to be in an infinite loop trying to determine the FocusEnvironment.

I fixed the issue by disabling user interaction with the view in which the AVPlayerLayer is installed. Since our video playback should disallow user interaction this is a valid solution for us. In this way the focus engine doesn't end up in an infinite loop and playback properly commences.

AVPlayer not playing
 
 
Q