有没有办法防止tvOS上的AVPlayerViewController获得焦点?
由于我们不能将其重写并实现为视图控制器或委托,因此不可能实现canBecomeFocused或shouldUpdateFocusInContext
有什么想法吗?
只是把Juraj的答案放在代码中:
playerViewController.view.isUserInteractionEnabled = false
以下内容将对您有所帮助:
func createPlayer() -> AVPlayerViewController {
let player = AVPlayerViewController()
player.view.frame = viewFrame
player.showsPlaybackControls = false
player.view.isUserInteractionEnabled = false
return player
}