ios - 使用 ReplayKit 录制屏幕上的任何应用程序

标签 ios iphone replaykit

我正在尝试创建一个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/

相关文章:

iphone - 比较两个字符串,比如日期

iphone - 内存泄漏 - Objective-C

ios - UIMenuController,它的目标在哪里?使困惑

ios - 从获取 API 响应的视频 url 获取/制作缩略图

c# - ReplayKit 制作的视频在 Xamarin 中不断跳帧

ios - 具有广播扩展接收音频的 ReplayKit

ios - UIButton位置改变|用户界面窗口 |重播套件

iphone - iOS中iCarousel/CATransform3D截图

ios - 前台应用程序之间的应用程序间通信

xcode - 使用 xcode 调试 "failed to launch in time"