AgentSkillsCN

swift-avfoundation-playback

在Apple各平台上,以“基础优先”的原则,提供Swift AVFoundation播放指南,涵盖AVAsset/AVPlayerItem/AVPlayer、时间轴定位、观察、排队、AirPlay、音频会话、画中画、HLS、DRM、广告,以及诊断功能。适用于实施或审查播放行为的场景。

SKILL.md
--- frontmatter
name: swift-avfoundation-playback
description: Fundamentals-first Swift AVFoundation playback guidance for AVAsset/AVPlayerItem/AVPlayer, seeking timelines, observation, queueing, AirPlay, audio session, PiP, HLS, DRM, ads, and diagnostics across Apple platforms. Use when implementing or reviewing playback behavior.

Swift AVFoundation Playback Skill

Use this skill to build playback behavior from a stable fundamentals core, then load only the topic files you need.

Read Order

  1. references/player-item-lifecycle.md
  2. references/seeking-and-timelines.md
  3. references/observable-setup.md
  4. references/time-observation.md
  5. references/intent-tracking.md

Topic Map

  • Queue and transitions: references/queue-playback.md, references/gapless-playback.md, references/coordinated-playback.md
  • System integrations: references/airplay-routing.md, references/audio-session.md, references/now-playing.md, references/picture-in-picture.md, references/platform-patterns.md
  • Streaming and reliability: references/hls-streaming.md, references/stall-recovery.md, references/error-handling.md
  • Protected and monetized playback: references/fairplay-drm.md, references/ad-insertion.md

Policy Rules

  • Treat AVFoundation transport properties as signals into your app state machine.
  • Keep UI mutation on the main actor.
  • If Apple documentation does not guarantee a behavior, express it as app policy.

Sources: