Agent skill · software engineering · dpearson2699

avkit

Create media playback experiences using AVKit. Use when adding video players with AVPlayerViewController, enabling Picture-in-Picture, routing media with AirPlay, using SwiftUI VideoPlayer views, configuring transport controls, displaying subtitles and closed captions, or integrating AVFoundation playback with system UI.

Why this skill is useful

Provides specific implementation patterns for AVKit media playback that the AI wouldn't reliably generate on its own.

What it needs

About 8k tokens when loaded. Last updated 2026-07-31. 973 stars on the source repository.

What this skill does

AVKit High-level media playback UI built on AVFoundation. Provides system-standard video players, Picture-in-Picture, AirPlay routing, transport controls, and subtitle/caption display. Targets Swift 6.3 / iOS 26+. Contents Setup AVPlayerViewController SwiftUI VideoPlayer Picture-in-Picture AirPlay Transport Controls and Playback Speed Subtitles and Closed Captions Common Mistakes Review Checklist References Setup Audio Session Configuration Playback apps need an audio session category and the matching background mode when they support background audio, AirPlay, or PiP. 1. Enable Background Modes > Audio, AirPlay, and Picture in Picture (the audio value in UIBackgroundModes) 2. Set the audio session category to .playback 3. Defer setActive(true) until playback begins so you do not interrupt other audio prematurely Imports AVPlayerViewController AVPlayerViewController is the standard UIKit player. It provides system playback controls, PiP, AirPlay, subtitles, and frame analysis out of the box. Do not subclass it. Basic Presentation (Full Screen) Inline (Embedded) Playback Add AVPlayerViewController as a child view controller for inline playback. Call addChild, add the view with constraints, then call didMove(toParent:). Key Properties Use contentOverlayView to add non-interactive views (watermarks, logos) between the video and transport controls. Delegate Adopt AVPlayerViewControllerDelegate to respond to full-screen transitions, PiP lifecycle events, interstitial playback, and media selection changes. Use the transition coordinator's animate(alongsideTransition:completion:) to synchronize your UI with full-screen animations. Display Readiness Observe isReadyForDisplay before showing the player to avoid a black flash: SwiftUI VideoPlayer The VideoPlayer SwiftUI view wraps AVKit's playback UI. Basic Usage Video Overlay Add a SwiftUI overlay above the video content and below the system playback controls. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills dpearson2699/avkit

View the source on GitHub

Browse the @skills marketplace