swiftship/internal/skills/data/ui/media/SKILL.md
Comprehensive media patterns: video playback, audio/music players, HLS streaming, remote images, AVAudioSession, memory management. Use when implementing any media-related features.
npx skillsauth add abdullah4ai/apple-dev-docs mediaInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Media playback URLs are permitted. The forbidden-patterns networking ban targets REST API clients (URLSession data tasks, custom HTTP clients), not media playback. The following are allowed:
AVPlayer with remote URLs (MP4, HLS .m3u8 streams)AsyncImage loading remote image URLsKFImage (Kingfisher) loading and caching remote imagesURLSession.shared.download(from:) only for downloading media files to local storageDo not use URLSession for REST API calls, JSON fetching, or custom networking — that ban still applies.
Pick the right pattern based on what you're building:
| Building | Reference | Key API |
|----------|-----------|---------|
| Video player | video-playback | VideoPlayer, AVPlayer |
| HLS/live streaming | video-playback | AVPlayer + .m3u8 URL |
| Video feed (TikTok-style) | video-playback + media-memory-management | FeedPlayerCoordinator |
| Music/audio player | audio-playback + audio-session | AVAudioPlayer (local) or AVPlayer (streaming) |
| Podcast player | audio-playback + audio-session | AVPlayer + Now Playing + Remote Commands |
| Background audio | audio-session | .playback category + UIBackgroundModes |
| Image gallery/feed | remote-images | KFImage (Kingfisher) |
| Simple remote image | remote-images | AsyncImage |
| Sound effects | audio-playback | AVAudioPlayer with .ambient category |
| Sample content | sample-media-urls | Public URLs, local audio generation |
| Feature | iOS | macOS | tvOS | watchOS | visionOS | |---------|-----|-------|------|---------|----------| | Video playback | VideoPlayer | AVPlayerView (NSViewRepresentable) | VideoPlayer | No | VideoPlayer | | Audio playback | AVAudioPlayer / AVPlayer | AVAudioPlayer / AVPlayer | AVAudioPlayer / AVPlayer | WKAudioFilePlayer | AVAudioPlayer / AVPlayer | | AVAudioSession | Yes | No (not needed) | Yes | Limited | Yes | | Background audio | Yes (UIBackgroundModes) | N/A | No | Limited | Yes | | Now Playing info | Yes | Yes | Limited | No | Yes | | Remote commands | Yes | Yes | Limited | No | Yes | | AsyncImage | Yes | Yes | Yes | Yes | Yes | | Kingfisher | Yes | Yes | Yes | No | Yes |
All already in the curated package registry — no new dependencies to add:
For background audio playback, add to the target's info section in project.yml:
UIBackgroundModes: ["audio"]
No other Info.plist keys are needed for basic media playback.
camera skill (not duplicated here)camera skillmaps skill (not duplicated here)swiftui skillhaptics skillThis skill includes the following reference documents (auto-loaded):
saytesting
Use for 3D games: racing, 3D sports, board games, marble maze, tower defense, bowling. SceneKit + SceneView architecture, 3D scene hierarchy, physics, game loop, primitives, materials, cameras, particles, audio.
documentation
Game UI patterns: SwiftUI HUD overlays on SpriteKit, menus (main/pause/game-over), virtual joystick/d-pad, score displays, health bars, tutorial onboarding.
tools
Download free game sprites/textures/3D models and generate procedural assets. Covers nw_download_asset tool, texture factories, sprite atlas organization, 3D model loading, and programmatic asset creation.
testing
Use for 2D games: arcade, puzzle, sports, ping pong, platformer, shooter, 2D racing. SpriteKit + SpriteView architecture, scene hierarchy, physics, game loop, audio, particles, game feel.