Swift Broadcast Replaykit停止录制

时间:2019-03-19 09:31:39

标签: ios swift broadcast replaykit rpsystembroadcastpickerview

我已经有了运行BroadCast的代码,现在我需要在App中使用一个按钮来停止广播,而不必去通知中心。

override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        UIScreen.main.addObserver(self, forKeyPath: "captured", options: .new, context: nil)

    }


func addRPkitVw() {



        let broadcastPickerView = RPSystemBroadcastPickerView(frame: CGRect(x: (holderVw.frame.width / 2) - 19, y: 0, width: 38, height: 38))
        holderVw.addSubview(broadcastPickerView)
        broadcastPickerView.backgroundColor = .clear
        broadcastPickerView.showsMicrophoneButton = true
    }

1 个答案:

答案 0 :(得分:0)

我也遇到同样的问题,但是您是否尝试过finishBroadcastWithError中的RPBroadcastSampleHandler。这是暂时的解决方案,因为有错误弹出窗口