Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Filter not being applied to preview screen using SCSwipeableFilterView #422

Open
anodev17 opened this issue May 7, 2018 · 0 comments

Comments

@anodev17
Copy link

anodev17 commented May 7, 2018

I am trying to apply a custom filter that user may swipe through when using app however when I try & apply custom filter it is not applied to screen, I have tried several different methods & it works successfully in example project, however not in my project. I am using a custom camera to record video then creating AVAsset from the URL. All other filters work except this one. Here is code

override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.gray
asset = AVAsset(url: videoURL)

     var galaxyFilter = SCFilter(ciImage: CIImage(image: UIImage(named: "camera_filter_3")!.alpha(value: 0.5))!)
    
    filterSwitch.frame = self.view.frame
    filterSwitch.contentMode = .scaleAspectFill
    filterSwitch.filters = [galaxyFilter]
    


    player.scImageView = filterSwitch
    self.view.addSubview(filterSwitch)
    
    filterSwitch.translatesAutoresizingMaskIntoConstraints = true

}

then I call the play method here
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

  player.setItemBy(asset!)
  player.play()

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant