avkit

Create AVKit and AVFoundation media playback UI with PiP and AirPlay.

Updated May 6, 2026
One-click install
npx skills add https://github.com/Roy-wonji/claude-config --skill avkit-roy-wonji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: avkit
Source: https://github.com/Roy-wonji/claude-config/tree/main/skills/swift-ios-skills/skills/avkit
Command: npx skills add https://github.com/Roy-wonji/claude-config --skill avkit-roy-wonji

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

AVKit standardizes high-quality iOS media playback so you can deliver a system-consistent video experience (including Picture-in-Picture and AirPlay) without fighting custom player UI edge cases.

Core Features & Use Cases

  • AVPlayerViewController-ready playback: Present full-screen or embed inline playback while leveraging system transport controls, subtitles, PiP, and AirPlay.
  • SwiftUI VideoPlayer integration: Use SwiftUI’s VideoPlayer for common playback, overlays, and straightforward state-driven setup.
  • PiP and media polish: Configure background/audio prerequisites, transport speeds, skip behavior, and subtitle/caption language options.
  • Use Case: You are adding video playback to an iOS app and need PiP + AirPlay with minimal UI work while supporting closed captions from the media.

Quick Start

Instruct the AI to generate the AVKit setup and an AVPlayerViewController-based SwiftUI or UIKit integration that enables Picture-in-Picture and supports AirPlay for a given streaming URL.

Frequently Asked Questions about avkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable Picture in Picture for video playback in SwiftUI?

Enable Picture in Picture for SwiftUI video playback by configuring the audio session with .playback and moviePlayback modes, adding the background mode in Info.plist, and managing PiP delegate restoration during view transitions.

Can I use AVPlayerViewController to add AirPlay routing to my iOS app?

AVPlayerViewController supports AirPlay routing natively within iOS apps. Presenting full-screen or embedding inline playback using AVKit automatically includes system transport controls and AirPlay routing without requiring custom UI components.

What's the best way to display closed captions and subtitles using AVKit?

Display closed captions and subtitles using AVPlayerViewController or SwiftUI VideoPlayer. Both components natively parse subtitle and closed-caption language options from the media stream, requiring only standard AVKit configuration without custom rendering.

Why does my AVKit video playback stop when the app enters the background?

AVKit video playback stops in the background if the audio session lacks the .playback and moviePlayback categories, or if the audio AirPlay background mode is missing from Info.plist. Configuring both ensures continuous media playback.

Does AVKit support customizing transport controls like skip behavior and playback speeds?

AVKit supports customizing transport controls including playback speeds and skip behavior. Configuring AVPlayerViewController allows you to adjust transport controls while maintaining system-consistent UI components for media playback.

How do I set up AVPlayerViewController in SwiftUI for a streaming URL?

Set up AVPlayerViewController in SwiftUI for a streaming URL by initializing an AVPlayer with the URL, passing it to the controller, and wrapping the UIKit component using UIViewControllerRepresentable to display system playback controls.