iOS 使用 QuickTime 播放器检测/阻止屏幕录制

标签 ios quicktime screen-recording

我想使用 QuickTime Player 阻止每个应用程序的屏幕录制或视频输出。

我用 UIScreen 检测到 hdmi 输出和 airplay。 但是 QuickTime Player 视频录制没有检测到。

如何检测 QuickTime Player?

谢谢。

最佳答案

从而不知道检测QuickTime Player录音。

但我找到了一些技巧的解决方案。

如果 QuickTime Player 录制正在运行,AVAudioSession 的输出端口类型已更改为 HDMIOutput。

所以我编码如下......(Swift 2.2)

func checkOutputPortType() {
    let asRoute = AVAudioSession.sharedInstance().currentRoute
    for output in asRoute.outputs {
        if output.portType == AVAudioSessionPortHDMI {
            // something you want..
        }
    }
}

将该函数插入 ViewDidLoad 并添加 AVAudioSessionRouteChangeNotification 通知。

NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(checkOutputPortType), name: AVAudioSessionRouteChangeNotification, object: nil)

谢谢。

关于iOS 使用 QuickTime 播放器检测/阻止屏幕录制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38713872/

相关文章:

javascript - 在Safari 8中播放.MOV文件的HTML —发生了什么变化?

google-chrome - 在 Chrome 中录制屏幕时如何达到 60 FPS?

c++ - 使用Bandicam库

python - 在 PC/Linux 上使用 Python 读取 Quicktime 电影的开始时间码

iOS - 使用 AVFoundation Framework 从相机模糊预览

ios - Objective-C : Create multiple UIPickerView with UITextFields programmatically

ios - 快速图表

cocoa - 使用外部视频硬件 - 初学者需要指导

angular - 如何在 Angular 2+ 应用程序中录制桌面屏幕

c++ - Objective-C++ 对 UI 的绝对混淆;最佳实践