ios - 在 AVPlayerViewController 中点击播放按钮时执行操作

标签 ios swift avplayer avplayerviewcontroller

我正在使用 AVPlayerViewController 播放视频。当在 AVPlayerViewController 中点击播放按钮时,我需要执行一些操作。但我无法检测到播放按钮是否被点击。为了更好地理解,这是一张图片。 enter image description here

任何帮助都会很有帮助。

最佳答案

官方没有任何完成按钮点击事件。

What you could do is associate a UITapGestureRecognizer with the view of the AVPlayerViewController, allowing the "menu" press type, and cancelling touches in view. Your selector callback will then be responsible for handling the pausing of playback and the dismissal of the AVPlayerViewController, but it would also allow you to perform any other cleanup required specific to your implementation.

或者您可以关注it .它是明智的解决方法。

关于ios - 在 AVPlayerViewController 中点击播放按钮时执行操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43752826/

相关文章:

ios - swift : How to get Inverse relationship in Parse. com

ios - Swift 如何在 UITableView 中为多个部分设置缓存标签值

ios - 当单元格移出屏幕时如何停止单元格中的 AVPlayer 播放

objective-c - 将数据从一个类传输到另一类

ios - 在 iOS 上保持蓝牙应用程序在后台运行的任何提示?

swift - 从 Firebase 数据库 IOS 检索信息时出现问题

objective-c - 在 AVPlayer 中静音 HTTP 实时流

ios - iOS:使用AES-128加密播放离线HLS

Swift:INImage 不遵守指定的宽度和高度

ios - UIActionsheet 不显示运行 iOS7 的 iPad 上的所有按钮