New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Developer guide for AVKit media playback covering AVPlayerViewController, SwiftUI VideoPlayer, Picture-in-Picture, AirPlay, and captions.

skills.sh installs
3.4K
GitHub stars
1.3K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers audio session setup, AVPlayerViewController presentation and inline embedding, SwiftUI VideoPlayer, and Picture-in-Picture behavior
  • Includes code patterns for full-screen and child-view-controller playback, delegate restore callbacks, and a referenced patterns file
  • Enforces a .playback audio session category and Background Modes configuration before Picture-in-Picture will work
  • Designed for iOS developers adding system-standard video playback to UIKit or SwiftUI apps targeting iOS 26 and later

Install

$ npx -y skills add dpearson2699/swift-ios-skills --skill avkit -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

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
import AVFoundation

Details

Repository
github.com/dpearson2699/swift-ios-skills
Categories
Mobile Apps, Frontend & UI Code
First seen
May 16, 2026

More from dpearson2699/swift-ios-skills

All 94

Similar to Avkit

More Mobile Apps