swift iOS播放来自SCSwipeableFilterView的视频

时间:2016-10-29 13:30:16

标签: ios swift cifilter recorder

我目前正在使用此广告单元https://github.com/rFlex/SCRecorder,尝试在播放时观看视频时允许用户滑过过滤器。视频播放正常,直到我添加过滤器代码,然后我得到一个空白屏幕。任何人都可以告诉我这是什么问题。我还将视图设置为它的xib文件中的SCSwipeableFilterView子类。这是代码:

@IBOutlet weak var filterView: SCSwipeableFilterView!






    if NSProcessInfo.processInfo().activeProcessorCount > 1 {
        self.customView.contentMode = .ScaleAspectFill
        var emptyFilter = SCFilter.emptyFilter()
        emptyFilter.name = "#nofilter"
        self.customView.filters = [emptyFilter, SCFilter(CIFilterName:"CIPhotoEffectNoir"), SCFilter(CIFilterName:"CIVignetteEffect"), SCFilter(CIFilterName:"CIPhotoEffect") ]
        self.newPlayer.SCImageView = self.customView
        self.customView.addObserver(self, forKeyPath: "selectedFilter", options: .New, context: nil)
    }
    else {
        var playerView = SCVideoPlayerView(player: newPlayer)
        playerView.playerLayer!.videoGravity = "ResizeAspectFill"
        playerView.frame = self.customView.frame
        playerView.autoresizingMask = self.customView.autoresizingMask
        self.customView.superview!.insertSubview(playerView, aboveSubview: self.customView)
        self.customView.removeFromSuperview()
    }

0 个答案:

没有答案