gpt4 book ai didi

ios - 使用避雷线从 OSX cocoa 应用程序录制 iOS 设备的屏幕

转载 作者:可可西里 更新时间:2023-11-01 05:03:10 26 4
gpt4 key购买 nike

可以在 Quicktime 中使用“新建电影录制”>“相机”下拉菜单> 选择 iOS 设备。 AppShowScreenflow两者都这样做。

我试过了

AppleScript

tell application "QuickTime Player"
set myrec to new movie recording
tell myrec
set current camera to video recording device named "Morten's iPod touch"
end tell
end tell

但这给了我

error "QuickTime Player got an error: Can’t set video recording device \"Morten's iPod touch\" of document \"Movie Recording\" to video recording device named \"Morten's iPod touch\" of document \"Movie Recording\"." number -10006 from video recording device "Morten's iPod touch" of document "Movie Recording"

AVFoundation由于 iOS 设备在 Quicktime 中显示为相机,我认为它会是 AVFoundation 中的捕获设备,但是这段代码

for device in AVCaptureDevice.devices() {
println(device)
}

给我我的 Facetime 高清摄像头和麦克风。

最佳答案

您必须选择加入才能在您的 OS X 应用程序中查看 iOS 屏幕设备。

参见“How do I set up a mirroring session between iOS 8 and Yosemite?

CMIOObjectPropertyAddress   prop    = {
kCMIOHardwarePropertyAllowScreenCaptureDevices,
kCMIOObjectPropertyScopeGlobal,
kCMIOObjectPropertyElementMaster
};
UInt32 allow = 1;

CMIOObjectSetPropertyData(kCMIOObjectSystemObject, &prop, 0, NULL, sizeof(allow), &allow);

您可以使用以下方法获取设备列表:

NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeMuxed];

关于ios - 使用避雷线从 OSX cocoa 应用程序录制 iOS 设备的屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30057972/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com