【问题标题】:Objective-C: How to use AVPictureInPictureControllerObjective-C:如何使用 AVPictureInPictureController
【发布时间】:2016-08-17 17:14:26
【问题描述】:

我正在尝试为我的 iPad 应用设置画中画,并且我有一个自定义视频播放器,因此我遵循以下示例代码:https://developer.apple.com/library/ios/samplecode/AVFoundationPiPPlayer/Introduction/Intro.html

我在 Objective-C 中实现这一点,下面的第二行代码给出了错误“在 AVPictureInPictureController 类型的对象上找不到属性 isPictureInPictureSupported。

AVPictureInPictureController *controller = [[AVPictureInPictureController alloc]init];

if (controller.isPictureInPictureSupported) {

【问题讨论】:

    标签: objective-c xcode avplayer avplayerlayer picture-in-picture


    【解决方案1】:

    isPictureInPictureSupportedAVPictureInPictureController 上的类方法,而不是实例属性。所以你这样称呼它:

    if ([AVPictureInPictureController isPictureInPictureSupported]) {
    

    【讨论】:

      猜你喜欢
      • 2015-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-10
      • 2015-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多