我正在尝试创建一个iPhone应用程序,它不仅可以记录应用程序的屏幕,而且如果放入后台,它会记录屏幕上的所有内容,包括其他应用程序。这就是“控制中心”录音的工作原理。不同的是,我想在没有用户干预的情况下立即访问视频,当然要征得用户的同意。
我已经在 iOS 12 上使用 ReplayKit2 实现了代码,该代码使用嵌入式广播上传扩展。我在网上没有找到任何像这样工作的示例。
我在 Bitbucket 上发布了代码:https://bitbucket.org/breelig/replaykitbroadcasttofile/src/master/
我在 SO 上发现的最相似的问题是:ReplayKit stops screen recording in background mode of the application or outside the app?
更新
基于@KaneCheshire 和@AndreyA 的良好回应。下面和其他随机来源我能够开发出一个有效的解决方案。请参阅上面我的 BitBucket 链接中的代码。
最佳答案
来自docs :
Apps on a user’s device can share the recording function, with each app having its own instance of RPScreenRecorder. Your app can record the audio and video inside of the app, along with user commentary through the microphone
录制屏幕的唯一其他方法是通过 Broadcast Upload Extension ,这需要用户通过控制中心启动它。
关于ios - 使用 ReplayKit 录制屏幕上的任何应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54480680/