Giter VIP home page Giter VIP logo

Comments (7)

Awalz avatar Awalz commented on May 14, 2024 1

AVCaptureDeviceDiscoverySession is only available in iOS 10. The framework supports iOS 8+. Does the issue persist if you ignore the deprecation warnings and run the source code as it?

from swiftycam.

Awalz avatar Awalz commented on May 14, 2024

Can you provide the source code or a sample project where this reproducible? I have never encountered this error

from swiftycam.

david-koch-pro avatar david-koch-pro commented on May 14, 2024

I've checked my source again and guessing this part has problem. (I modified if condition because original code is deprecated)

fileprivate class func deviceWithMediaType(_ mediaType: String, preferringPosition position: AVCaptureDevicePosition) -> AVCaptureDevice? {
        if let devices = AVCaptureDeviceDiscoverySession(deviceTypes: [], mediaType: mediaType, position: position).devices {
            return devices.filter({ $0.position == position }).first
        }
        return nil
    }

from swiftycam.

david-koch-pro avatar david-koch-pro commented on May 14, 2024

If I ignore the deprecation warnings, it's running well...

from swiftycam.

david-koch-pro avatar david-koch-pro commented on May 14, 2024

I was wrong. Added deviceTypes and running well.
let devices = AVCaptureDeviceDiscoverySession(deviceTypes: [AVCaptureDeviceType.builtInWideAngleCamera], mediaType: mediaType, position: position).devices

from swiftycam.

Awalz avatar Awalz commented on May 14, 2024

Sorry you were wrong about what? That its running well with the original source, or that that was the part of the refactored code that is giving you problems?

from swiftycam.

david-koch-pro avatar david-koch-pro commented on May 14, 2024

Original source is running well and new code fixed for deprecation is also running well.

from swiftycam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.