IOS devicesWithMediaType deprecated

前端 未结 2 1136
一个人的身影
一个人的身影 2021-02-09 12:02

I am currently using the method:

NSArray *captureDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];

to get a list of devices but X

2条回答
  •  悲&欢浪女
    2021-02-09 12:40

    AVCaptureDevice.default(.builtInWideAngleCamera, for: AVMediaTypeVideo, position: .front)
    

    I think something like that would work. I think the AVCapture.DiscoverySession's initializer may be helpful as well. See the documentation and the stack overflow post on something similar in swift. Let me know if it helped!:)

    • https://developer.apple.com/documentation/avfoundation/avcapturedevice
    • How to get front camera, back camera and audio with AVCaptureDeviceDiscoverySession
    • https://developer.apple.com/documentation/avfoundation/avcapturedevice.discoverysession/2361539-init

提交回复
热议问题