热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

类型“AVCapturePhotoOutput”的值没有成员“outputSettings”

如何解决《类型“AVCapturePhotoOutput”的值没有成员“outputSettings”》经验,为你挑选了1个好方法。

很好奇,在Swift 4中会是什么? stimageout = AVCapturePhotoOutput() stimageout?.outputSettings = [AVVideoCodecKey : AVVideoCodecJPEG]

目前,它的错误Value of type 'AVCapturePhotoOutput' has no member 'outputSettings'是很奇怪的,因为我没有记着苹果更改它的记录。

这不是“乞求帮助”类型的问题。我很好奇Apple是否更改了此设置以及我需要采取的步骤来解决此问题。

提前致谢。:)



1> nathangitter..:

问题是outputSettings财产而AVCaptureStillImageOutput不是财产AVCapturePhotoOutput

AVCaptureStillImageOutput在iOS 10中已弃用,因此对于iOS 10+,请AVCapturePhotoOutput改用。要使用新的API设置设置,可以使用AVCapturePhotoSettings对象。

let stimageout = AVCapturePhotoOutput()
let settings = AVCapturePhotoSettings()
settings.livePhotoVideoCodecType = .jpeg
stimageout.capturePhoto(with: settings, delegate: self)

Apple的AVCapturePhotoOutput文档:https://developer.apple.com/documentation/avfoundation/avcapturephotooutput


推荐阅读
author-avatar
什锦平
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有