AVPlayerViewController 抛出 CATransformLayer 警告

问题描述

我想在我的应用程序中播放一个短视频,为了简单起见,我使用标准的 AVPlayerViewController

        guard let path = Bundle.main.path(forResource: video,ofType: "m4v") else {
            debugPrint("\(video).m4v not found")
            return
        }
        let videoURL = NSURL(fileURLWithPath: path)

//         Create an AVPlayer,passing it the local video url path
        let player = AVPlayer(url: videoURL as URL)
        let controller = AVPlayerViewController()
        videoController.videoGravity = .resizeAspectFill
        videoController.player = player
        present(videoController,animated: false) {
            player.play()
        }

视频播放正常,但显示的 ViewController 不断发出 CATransformLayer 警告:

2020-12-19 16:00:29.631839+0100 EXAMPLEAPP[1994:246899] <CATransformLayer: 0x600002660840> - changing property masksToBounds in transform-only layer,will have no effect
2020-12-19 16:00:29.632359+0100 EXAMPLEAPP[1994:246899] <CATransformLayer: 0x600002668e60> - changing property masksToBounds in transform-only layer,will have no effect
2020-12-19 16:00:29.659760+0100 EXAMPLEAPP[1994:246899] <CATransformLayer: 0x600002669880> - changing property masksToBounds in transform-only layer,will have no effect
2020-12-19 16:00:29.661994+0100 EXAMPLEAPP[1994:246899] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x60000268bee0> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2020-12-19 16:00:29.753985+0100 EXAMPLEAPP[1994:246899] <CATransformLayer: 0x60000266de00> - changing property masksToBounds in transform-only layer,will have no effect
2020-12-19 16:00:29.756420+0100 EXAMPLEAPP[1994:246899] <CATransformLayer: 0x6000026701e0> - changing property masksToBounds in transform-only layer,will have no effect
2020-12-19 16:00:29.806045+0100 EXAMPLEAPP[1994:246899] <CATransformLayer: 0x600002669880> - changing property allowsGroupBlending in transform-only layer,will have no effect
2020-12-19 16:00:29.806191+0100 EXAMPLEAPP[1994:246899] <CATransformLayer: 0x60000266de00> - changing property allowsGroupBlending in transform-only layer,will have no effect

我不知道他说的是哪一层 tbh,也许有人可以指导我朝着正确的方向发展?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)