Code Monkey home page Code Monkey logo

Comments (12)

otymartin avatar otymartin commented on May 18, 2024 2

sharedInstance.videoConfiguration.transform = CGAffineTransform(scaleX: -1, y: 1)

this was the only thing that worked. setting mirroringMode has no effect.

from nextlevel.

cybercent avatar cybercent commented on May 18, 2024 1

Meanwhile, if someone encounters the same issue, an alternate solution to obtain the video mirrored is to change the video configuration transform.

sharedInstance.videoConfiguration.transform = CGAffineTransform(scaleX: -1, y: 1)

from nextlevel.

piemonte avatar piemonte commented on May 18, 2024

hey @Slash7 thanks, much appreciated. i'll try fix this in my next free opportunity.

from nextlevel.

piemonte avatar piemonte commented on May 18, 2024

#68

hey @Slash7 this will fix one crash, may not fix the other you mention

from nextlevel.

cybercent avatar cybercent commented on May 18, 2024

👍🏻

from nextlevel.

patthehuman avatar patthehuman commented on May 18, 2024

How do you actually produce an instagram or snapchat style front facing session without flipping the users face?

from nextlevel.

otymartin avatar otymartin commented on May 18, 2024

@patthehuman
My default device is .front

I set NextLevel.shared.mirroringMode = .on in my viewDidLoad

And do this in my delegate

public func nextLevelDevicePositionDidChange(_ nextLevel: NextLevel) {
        switch nextLevel.devicePosition {
        case .back:
           NextLevel.shared.videoConfiguration.transform = CGAffineTransform(scaleX: 1, y: 1)
        case .front:
            NextLevel.shared.videoConfiguration.transform = CGAffineTransform(scaleX: -1, y: 1)
        default:
            break
        }
    }

Works well.

from nextlevel.

patthehuman avatar patthehuman commented on May 18, 2024

@otymartin

thank you. I have implemented that. I am getting this error:

Method 'nextLevel(:didUpdateVideoZoomFactor:)' has different argument labels from those required by protocol 'NextLevelDeviceDelegate' ('nextLevel(:didChangeLensPosition:)')

Are you?

from nextlevel.

otymartin avatar otymartin commented on May 18, 2024

@patthehuman You probably just wrote the delegate method wrong or have minor syntax error.. I would just copy these.

/// Video Zoom
  public func nextLevel(_ nextLevel: NextLevel, didUpdateVideoZoomFactor videoZoomFactor: Float) {}

  public func nextLevel(_ nextLevel: NextLevel, didChangeLensPosition lensPosition: Float) {}

from nextlevel.

patthehuman avatar patthehuman commented on May 18, 2024

This is not working for me actually

from nextlevel.

otymartin avatar otymartin commented on May 18, 2024

@patthehuman

Can you show your code

from nextlevel.

piv199 avatar piv199 commented on May 18, 2024

videoConfiguration.transform = CGAffineTransform(x: -1, y: 1)

for me this produces videos with 180 degrees rotation (though they are opened normally in AVPlayer, QuickTime)

from nextlevel.

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.