← ClaudeAtlas

avkitlisted

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.
thiennc-tesoglobal/ios-skills · ★ 3 · AI & Automation · score 66
Install: claude install-skill thiennc-tesoglobal/ios-skills
# 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](#setup) - [AVPlayerViewController](#avplayerviewcontroller) - [SwiftUI VideoPlayer](#swiftui-videoplayer) - [Picture-in-Picture](#picture-in-picture) - [AirPlay](#airplay) - [Transport Controls and Playback Speed](#transport-controls-and-playback-speed) - [Subtitles and Closed Captions](#subtitles-and-closed-captions) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#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 ```swift import AVFoundation func configureAudioSessionForPlayback() { let session = AVAudioSession.sharedInstance() do { try session.setCategory(.playback, mode: .moviePlayback) } catch { print("Audio session category failed: \(error)") } } func activateAudioSessionWhenPlaybackBegins() { do { try AVAudioSession.sharedInstance().setActive(true)