/duology-features:duo-mediafrom duology-features
Handles video and audio playback on Apple's foldable iPhone Duo, ensuring uninterrupted playback through fold, unfold, and rotation. Covers tabletop and book-pose players, up next queue, Picture in Picture, Now Playing, and background audio using AVPlayer, AVPlayerViewController, AVPictureInPictureController, and MPNowPlayingSession.
Ships in duology-features. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
People open, close and fold iPhone Duo while something plays. The video must not stop, restart or flash, and the controls must land where hands can reach them in every pose. This skill covers players, the tabletop layout, "up next", Picture in Picture, Now Playing and the audio session.
Load neighbours when the task needs them: duo-continuity (where state lives, for every kind of state), duo-postures (every pose, and the tabletop recipe with FoldRegionsLayout), duo-layout (ArrangementView in depth), duo-scenes (Split View and windows), duo-camera (capture).
"Tabletop" and "book" are Duology's words for what Apple describes as the phone seated on a table like a laptop, and partly folded like a book. Neither is an API. Labels: measured means we ran it on the iPhone Duo simulator (iOS 27.1); derived means reasoning from Apple's words or our measurements; unverified means we could not check it. Full source list: reference/sources.md.
AVPlayer per window, in a model owned above every layout switch. Views only show it.onDisappear.toolbarVerticalBehavior(.disabled), as a fixed choice for that screen.A fold resizes the window, often changes its size class, and rebuilds the views below a layout switch. A player created in one of those views starts again from zero (Tech Talk 111461, duo-continuity).
import AVKit
import SwiftUI
// requires: PlaybackModel (references/player-ownership.md)
struct PlayerRoot: View {
@State private var playback = PlaybackModel() // the window root owns the player
var body: some View {
VideoPlayer(player: playback.player) // a view of the player, nothing more
.ignoresSafeArea()
}
}
PlaybackModel holds the player, the queue, Picture in Picture and Now Playing. Its play(_:) ignores the item already playing, so a view that calls it again after a fold restarts nothing.AVPlayer is main-actor isolated in the iOS 27.1 SDK (AVPlayer.h), so the model is @MainActor.AVPlayerLayer view was created once. duo-continuity measured the same with VideoPlayer rebuilt on each flip.The model, the root, what to avoid, and UIKit: references/player-ownership.md.
System player (AVPlayerViewController, VideoPlayer) | Your controls on an AVPlayerLayer | |
|---|---|---|
| Controls | Drawn over the video | Wherever you put them, below the fold included |
| Picture in Picture | AVPlayerViewController: built in once the audio session and background mode are set. Apple's guides don't cover VideoPlayer. | AVPictureInPictureController |
| Now Playing | AVPlayerViewController updates it by default | MPNowPlayingSession from your model |
| Captions, AirPlay | In the system controls | Yours to add (AVRoutePickerView for AirPlay) |
| Apple's advice | Prefer it (HIG: Playing video) | Match the system player's behaviour if you build one |
On Duo the difference is tabletop. The system player draws its controls over the video; Apple's tabletop advice wants them on the bottom half. Whether the system player moves them when the phone is partly folded is not measured yet (references/testing.md).
Apple names one optional layout for a single pose: the phone on a table, media in the top region, tappable controls on the stable bottom region, with the same controls and hierarchy as every other pose (Tech Talk 111466, Tech Talk 111463).
An ArrangementView with .overlay does it with no fold code. Measured on the simulator (20 Oct 2026):
| Pose | Window | Primary (controls, up next) | Secondary (video) | overlayArrangementZIndex read in the primary |
|---|---|---|---|---|
| Closed | 466 × 678 pt | Floats over the video, whole window | Whole window | 1 |
| Open, flat | 951 × 669 pt | Floats over the video, whole window | Whole window | 1 |
| Book | 951 × 669 pt | Trailing region, 455 pt wide | Leading region | 0 |
| Tabletop | 669 × 951 pt | Bottom region, 455 pt tall | Top region | 0 |
import AVKit
import SwiftUI
// requires: PlaybackModel (references/player-ownership.md)
// requires: NowPlayingPanel, VideoSurface (references/tabletop-and-up-next.md)
@available(iOS 27.1, *)
struct TabletopWatchScreen: View {
let playback: PlaybackModel // owned by the window root
var body: some View {
ArrangementView {
NowPlayingPanel(playback: playback) // primary: what people touch
} secondary: {
VideoSurface(playback: playback) // secondary: what people watch
.ignoresSafeArea()
}
.arrangementViewStyle(.overlay)
.background(.black)
.toolbarVerticalBehavior(.disabled) // fixed for this screen, never toggled
}
}
List, a ScrollView or a NavigationSplitView (overview). Present the player full screen or inside a NavigationStack.if #available(iOS 27.1, *) when the app deploys lower. Below 27.1 keep the controls over the video.FoldRegionsLayout in duo-postures, used by the gallery's tabletop player screen. Screenshots of it closed, open, in book and in tabletop: gallery README.Apple's layouts talk builds exactly this: a player and an "up next" view in an overlay arrangement, with a collapsed "up next" while it floats and an expanded one once the phone folds, switched by overlayArrangementZIndex (Tech Talk 111463).
import SwiftUI
// requires: PlaybackModel (references/player-ownership.md), UpNextList (references/tabletop-and-up-next.md)
/// Pass this as the arrangement's primary. The view you pass in reads default
/// arrangement values, so read them one view down (duo-layout).
@available(iOS 27.1, *)
struct UpNextPrimary: View {
let playback: PlaybackModel
var body: some View {
ZStack { UpNextPanel(playback: playback) }
}
}
@available(iOS 27.1, *)
struct UpNextPanel: View {
let playback: PlaybackModel
@Environment(\.overlayArrangementZIndex) private var zIndex
var body: some View {
// Measured: 1 while floating over the video, 0 once side by side or stacked.
UpNextList(playback: playback, limit: zIndex > 0 ? 1 : 6)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottomLeading)
}
}
The full panel with transport controls, the video surface and UIKit: references/tabletop-and-up-next.md.
On Duo people can pin a Picture in Picture video to the top of the screen. The app below resizes to the space left, and when the phone is partly folded the pinned video grows to half the screen (Tech Talk 111466).
canStartPictureInPictureAutomaticallyFromInline when it is the main thing on screen, so it floats when people leave the app.scenePhase stayed active, duo-scenes), so a fold shouldn't start Picture in Picture (derived).isPictureInPictureSupported() returned false on the iPhone Duo simulator. Test it on a device.Code for a custom player, and what the restore callback needs: references/pip-and-audio.md.
.playback, mode .moviePlayback for video. Set it before playback; an AVPlayer activates the session itself when it starts (AVPlayer.h).AVPlayerViewController keeps Now Playing up to date by default. With your own controls, use MPNowPlayingSession(players:) with automaticallyPublishesNowPlayingInfo (iOS 16), from the model.interruptionNotification; read resumptionRecommendationNotification instead (AVAudioSessionTypes.h). Pause when headphones come out (HIG: Playing audio).duo-scenes). Use AirPlay for a second screen.Details: references/pip-and-audio.md.
Keep one AVPlayerViewController in a container that never goes away (duo-continuity). For tabletop, UIArrangementViewController with UIOverlayArrangement: panel in .primary, video in .secondary, and state(for: .primary)?.zIndex to switch the panel. Details: references/tabletop-and-up-next.md.
duo-pose from duo-pose-matrix presses them for you if the user has given Accessibility permission.What we measured, how, and a device checklist: references/testing.md.
AVPlayer per window, created in a model the window root owns.onDisappear, onAppear, a size-class change or a fold.timeControlStatus), not a flag in a view.overlayArrangementZIndex one view down, or uses a split when it must never be covered.List, ScrollView or NavigationSplitView; iOS 27.1 APIs gated when the app deploys lower.toolbarVerticalBehavior(.disabled) once, not from view state..playback, the background mode set, Now Playing published from the model.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kimeur/duology --plugin duology-features8 skills in this plugin
/duo-app-intentsApp Intents on iPhone Duo: AppIntent, AppEntity with EntityStringQuery, OpenIntent with TargetContentProvidingIntent and onAppIntentExecution (UISceneAppIntent and AppIntentSceneDelegate in UIKit) to show the right item in the right pane or window, handlesExternalEvents to pick the window, intents that work with the phone closed (supportedModes .background, IntentDialog, ProvidesDialog, isVoiceOnly), onscreen awareness when two panes are visible (appEntityIdentifier, appEntityIdentifier(forSelectionType:), NSUserActivity), App Shortcuts (AppShortcutsProvider) and AppIntentsTesting runs on the Duo simulator in each pose. Use when an app adds Siri, Shortcuts, Spotlight or Apple Intelligence actions, when an intent opens the wrong pane or an extra window, or when an intent must work while the phone is closed./duo-cameraCamera 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./duo-gamesBuilds games for iPhone Duo, Apple's foldable. The game fills the closed outer display, the open inner display, book pose and tabletop by changing its aspect ratio instead of letterboxing, as Apple's HIG asks; touch controls stay off the fold; and in tabletop the world sits above the fold with the controls below it, like a handheld console. Use when you build or port a SpriteKit, Metal or SwiftUI game, when a game letterboxes, restarts or loses input on fold or unfold, or when you add touch controls or game controller support. Covers SKScene .resizeFill with a camera that keeps the play area in view, one scene or renderer that survives every fold (measured), MTKView drawableSizeWillChange, a UIWindowScene display link that follows the scene to the other display, TouchZones split at the .division reserved region, GameLayout for tabletop, GCController and the simulator's own Gamepad, GCVirtualController and Touch Controller placement, orientation locks the inner display ignores, and two-player games./duo-intelligenceAdds Foundation Models to an iPhone Duo app: the on-device model (SystemLanguageModel) and the Private Cloud Compute server model (PrivateCloudComputeLanguageModel) behind one LanguageModelSession API, an AI side pane beside the content when the phone is open or in book pose (split ArrangementView) and a one-line summary when it is closed or in tabletop, streaming (streamResponse with @Generable partial snapshots) into a pane that keeps going through fold and unfold, availability checks and non-AI fallbacks, quota and error handling (LanguageModelError), tool calling, image prompts (Attachment), reasoning levels (ContextOptions) and privacy. Use when someone adds summaries, an assistant, chat, tagging or image understanding to an app that runs on iPhone Duo, or when an AI feature restarts on a fold, sits in the fold or doesn't fit the outer display./duo-readingBuilds reading and document screens for iPhone Duo, Apple's foldable: one page on the closed outer display, two facing pages split at the fold when the phone is open and held wide or folded like a book, and in tabletop the page above the fold with page turns below it. Use when you build an e-reader, a long-form or PDF viewer, notes beside a document, or when a reader loses its place on fold, unfold, rotation or a Dynamic Type change. Covers TextKit 1 pagination (NSLayoutManager, NSTextContainer) that keeps the place as a character offset, PagedReader with FoldGeometry and reservedRegions(kind: .division, options: .includeInactive), notes that move between the trailing region and a sheet, Dynamic Type reflow, text selection that stays inside one page (iOS 27 Text range selection, a UITextView edit menu Add to Notes action, drag), PDFKit two-up centred on the fold, and Apple Pencil, which Apple says comes later in 2026 (what it will support is unverified)./duo-swiftui-27The iOS 27 SwiftUI changes that matter on iPhone Duo, Apple's foldable, where every fold, unfold and rotation resizes the app. Use it when building with Xcode 27.1 breaks a view (@State macro, ContentBuilder, TN3211), when a grid or list that reflows between the outer and inner display needs drag to reorder or swipe actions, or when you adopt the new tab, toolbar, dialog or AsyncImage APIs in a Duo app. Covers the @State macro through a fold and its source breaks, reorderable() and reorderContainer(for:isEnabled:move:) in a 2 or 4 column grid and across the fold, swipeActionsContainer() outside List, Tab(role: .prominent) at the foot of the vertical tab bar, toolbarMinimizationBehavior(_:for:) (the talk's toolbarMinimizeBehavior is not in the SDK), visibilityPriority, ToolbarOverflowMenu, topBarPinnedTrailing, alert and confirmationDialog with item:, AsyncImage HTTP caching and asyncImageURLSession(_:), and resizable iPhone apps. Points to Apple's swiftui-whats-new-27 Xcode skill for the rest.Other plugins' skills for the same job