【问题标题】:Swift AVPlayerViewController add target on playing videoSwift AVPlayerViewController 在播放视频时添加目标
【发布时间】:2016-08-26 13:53:37
【问题描述】:

我正在使用 AVPlayerViewController 播放视频。问题是如何检测视频是否开始播放?通常是添加目标,但我找不到可以在该事件中添加的任何目标。有人能帮我吗?提前致谢。

【问题讨论】:

    标签: swift avplayerviewcontroller addtarget


    【解决方案1】:

    使用这个回调方法playerViewControllerDidStartPictureInPicture来自apple documentation

    例如

    optional func playerViewControllerDidStartPictureInPicture(_ playerViewController: AVPlayerViewController){
         //Called when Picture in Picture playback has started.
    }
    

    【讨论】:

    • 嗯。我不想在图片功能中添加图片。我想要的是检测用户点击播放按钮时的事件
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多