我在iOS16上有一个问题,关闭按钮没有像往常一样关闭AVPlayer,但它在iOS12上工作。
你知道我错过了什么吗?
func didTapOnPlay(url: URL) {
let player = AVPlayer(url: url)
playerViewController.player = player
NotificationCenter.default.addObserver(
self,
selector: #selector(playerDidReachEndNotificationHandler),
name: NSNotification.Name(rawValue: "AVPlayerItemDidPlayToEndTimeNotification"),
object: player.currentItem)
router.present(playerViewController, animated: false) { [weak self] in
self?.playerViewController.player?.play()
}
}
1条答案
按热度按时间waxmsbnn1#
之前:
我认为这是iOS 16的一个bug,因为当我将动画参数设置为true时,它就可以工作了
编辑:
在iOS 16.1上已修复