跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
视频与音频

duo-camera

Camera capture on iPhone Duo, Apple's foldable. Use when an app takes photos or video, runs a video call or shows a camera preview, and must work closed (outer display), open (inner display), partly folded (book, tabletop), open and turned around (flipped) and through fold and unfold. Covers the virtual front camera (.builtInWideAngleCamera or .builtInUltraWideCamera at .front; shared features only, up to 1080p at 60 fps, no depth), the physical front cameras (.builtInOuterUltraWideCamera, .builtInInnerUltraWideCamera), choosing a camera by the way it faces with AVCaptureDeviceDirectionCoordinator (AVKit) and AVCaptureDeviceDescriptor, mirroring a rear-camera selfie, AVCaptureDevice.RotationCoordinator across displays, the square front sensor and dynamicAspectRatio, a subject preview on the outer display with CameraCaptureAccessory, tabletop hands-free capture, and Split View interruptions. The simulator has no camera: the code typechecks; capture is unverified on a device.

Kimeur · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add Kimeur/duology --skill duo-camera

技能说明


name: duo-camera description: "Camera capture on iPhone Duo, Apple's foldable. Use when an app takes photos or video, runs a video call or shows a camera preview, and must work closed (outer display), open (inner display), partly folded (book, tabletop), open and turned around (flipped) and through fold and unfold. Covers the virtual front camera (.builtInWideAngleCamera or .builtInUltraWideCamera at .front; shared features only, up to 1080p at 60 fps, no depth), the physical front cameras (.builtInOuterUltraWideCamera, .builtInInnerUltraWideCamera), choosing a camera by the way it faces with AVCaptureDeviceDirectionCoordinator (AVKit) and AVCaptureDeviceDescriptor, mirroring a rear-camera selfie, AVCaptureDevice.RotationCoordinator across displays, the square front sensor and dynamicAspectRatio, a subject preview on the outer display with CameraCaptureAccessory, tabletop hands-free capture, and Split View interruptions. The simulator has no camera: the code typechecks; capture is unverified on a device." metadata: verified: "Xcode 27.1 (27A9275), iOS 27.1 simulator, device: no" sources: "https://github.com/Kimeur/duology/blob/main/reference/sources.md"

duo-camera

iPhone Duo has a front camera above each display, rear cameras, and a hinge that turns them around. Which way a camera points depends on the display your app is on. This skill tells you which camera to use, how to follow it through a fold, and how to lay out capture for each pose.

Load neighbours when the task needs them: duo-scenes (the camera capture accessory's lifecycle and UIKit registration), duo-postures (tabletop and flipped layouts), duo-layout (reserved regions, including the inner camera's occlusion), duo-continuity (state through a fold). To start a new camera app with all of this in place, use recipe-camera-studio.

No camera in the simulator. The iPhone Duo simulator has no camera. Measured (20 Oct 2026): every discovery session returned no device, and a direction coordinator kept an empty map and never called its handler (we watched for up to 2 minutes). So every capture behaviour in this skill comes from Apple's pages and is unverified on a device. All Swift code here typechecks against the iOS 27.1 SDK; none of it has run with a real camera.

Labels: measured means we ran it on the iPhone Duo simulator (iOS 27.1). Derived means reasoning from Apple's numbers or our measurements. Unverified means we could not check it. Everything else comes from Apple, linked inline. Full source list: reference/sources.md.

Rules

  1. Start with the virtual front camera. Front-camera code you already have works on Duo unchanged.
  2. Use the physical cameras only when capture is the app's main job, or when you need what one camera alone has: 4K or 120 fps on the outer camera, depth, a rear-camera selfie.
  3. With physical cameras, ask AVCaptureDeviceDirectionCoordinator which way each one faces. Never infer it from position or the device type.
  4. One coordinator per preview view. A preview on each display needs one each.
  5. No AVFoundation calls in the coordinator's handler. Hand the descriptor to the actor that owns the session.
  6. Mirror by direction: mirror a rear camera that faces the person; don't mirror a front camera that faces away.
  7. Make a new rotation coordinator after every camera switch. Then turn off sensor orientation compensation.
  8. Keep the shutter and every control out of the fold and away from the inner camera, which occludes the view while it runs.
  9. The app works without the outer-display accessory, in Split View, and on iPhones with one display.

1. The cameras

CameraHow to get itFacesWhat it gives you
Virtual front camera.builtInWideAngleCamera or .builtInUltraWideCamera at .front. isVirtualDevice is true.The display your app is on: inner when open, outer when closedOnly what both front cameras share: up to 1080p at 60 fps, no depth. The system switches for you (talk 111465).
Outer front.builtInOuterUltraWideCameraThe same way as the outer displaySquare sensor. Up to 4K and 120 fps per the talk; Apple's spec page lists 4K up to 60 fps and 120 fps slo-mo at 1080p.
Inner front.builtInInnerUltraWideCameraThe same way as the inner display. Under the display, hidden until it runs.Square sensor, 1080p up to 60 fps (talk 111465)
RearYour usual rear types, position == .backAway from the person on the inner display; toward them when the phone is turned aroundAs on other iPhones
  • Depth comes only through the physical cameras (talk 111465). Check a format's supportedDepthDataFormats before you rely on it.
  • Both physical front cameras report position == .front. That is where a camera sits, not where it points (guide).
  • AVCaptureDevice.h says the outer and inner types can only be discovered with a discovery session, so use one rather than AVCaptureDevice.default(_:for:position:). Both are iOS 27.1 and unavailable on Mac Catalyst.
  • The talk and the spec page disagree on the outer camera's frame rate. Read formats at run time; never hard-code either number. Helpers: references/cameras.md.

2. Virtual front camera or physical cameras

The app isUse
A video call, a social selfie, a face scan, any app that already uses the front cameraThe virtual front camera
A camera app, or anything that needs 4K or 120 fps on the outer camera, depth, or a rear-camera selfieThe physical cameras, with a directi
阅读完整来源 ↗